Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expose method processCss which returns inlined css only #19

Open
Warxcell opened this issue Oct 28, 2024 · 0 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Warxcell
Copy link

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 GoogleChromeLabs/critters#78

@danielroe danielroe added enhancement New feature or request good first issue Good for newcomers labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants