Skip to content

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

Open
@Warxcell

Description

@Warxcell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions