Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

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

Closed
Warxcell opened this issue Dec 4, 2023 · 1 comment
Closed

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
@kara
Copy link
Collaborator

kara commented Oct 25, 2024

Closing this issue because ownership of Critters has moved to the Nuxt team, who will be maintaining the project going forward. This repo is archived and won't receive any future updates.

If the issue is still relevant, please re-post it to the actively-maintained fork at https://github.com/danielroe/beasties.

@kara kara closed this as completed Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants