Skip to content

Conversation

fengzilong
Copy link

@fengzilong fengzilong commented Sep 19, 2021

Most critical css tools generate static css from static html and static css

But when it comes to SSR, most pages are personalized, and the critical css is dynamically generated according to query parameters or logined user

This is why compile-critical-css is created

compile-critical-css compiles css string into a function (in build time) like

function ( classlist ) {
  return `generated_css_from_classlist`
}

The generated function is dependency-free( without postcss, so less performance impact )

We can import this function in our NodeJS application to extract critical css and inline it into html ( in runtime )

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

Successfully merging this pull request may close these issues.

1 participant