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

Planning: inline critical CSS #4

Closed
davidtheclark opened this issue Jun 6, 2017 · 2 comments
Closed

Planning: inline critical CSS #4

davidtheclark opened this issue Jun 6, 2017 · 2 comments
Labels

Comments

@davidtheclark
Copy link
Contributor

davidtheclark commented Jun 6, 2017

In dotcom we have a little system that parses static HTML with Cheerio, then uses PostCSS to and document.querySelector to create a CSS file that only contains selectors that match something on the page.

Because it's pretty slow, we split it across available processes.

I ran across an npm module with the same Cheerio-based system: https://github.com/tscanlin/css-razor. We could try using and contributing to that public module, instead of keeping our own. The code isn't super complicated, so I think it's perfectly fine to keep our own. But do we want to contribute to that project? @tristen what do you think?

davidtheclark pushed a commit that referenced this issue Jun 9, 2017
Closes #17.
Closes #4.
davidtheclark added a commit that referenced this issue Jun 9, 2017
Closes #17.
Closes #4.
@tristen
Copy link
Member

tristen commented Jun 19, 2017

You're probably well past this now but I'm a little confused by the title. You want to replace this with css-razor? Makes sense to me! What would need to be contributed to that project to get it to work for our needs? and how does this relate to inlining critical CSS?

@davidtheclark
Copy link
Contributor Author

@tristen: Actually I made https://github.com/mapbox/css-sieve for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants