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 #148

Open
Warxcell opened this issue Dec 4, 2023 · 0 comments
Open

Comments

@Warxcell
Copy link

Warxcell commented Dec 4, 2023

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('</head>', criticalCSS + '</head>')

This will help also with #78

@Warxcell Warxcell changed the title Expose method processCss which returns inlined css Feature Request: Expose method processCss which returns inlined css Dec 4, 2023
@Warxcell Warxcell changed the title Feature Request: Expose method processCss which returns inlined css Feature Request: Expose method processCss which returns inlined css only Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant