danielroe / danielroe/beasties
Feature Request: Expose method processCss which returns inlined css only
Open
enhancement
good first issue
- Dominant language
- TypeScript
- Stars
- 699
- Forks
- 25
- Avg merge
- 20h 13m
- Merged PRs (30d)
- 35
Description
Use-case is to be able to use critters inside SSR, by processing only CSS and caching processed CSS - allowing the content to evolve independently from the processed CSS. Something like
let html = .... rendered html in ssr ...
const cacheKey = .... some logic ....
const criticalCSS = getInlinedCriticalCSSFromCache(cacheKey) ?? critters.processCss(html);
html = html.replace('', criticalCSS + '')
This will help also with https://github.com/GoogleChromeLabs/critters/issues/78
Contributor guide
Assessment
This issue has not been assessed yet.