RFC: CSS extraction
See original GitHub issueMain point is to do a pass over their own components + node modules dependencies that are using compiled components and then to extract them to a single, atomic, css sheet.
This would need to be a bundler plugin. Webpack & Parcel.
The idea:
- You have a component library, let’s call it
@catlaskit
- You have a product, let’s call it
Gira
- Product
Gira
uses compiled components from@catlaskit
- Product
Gira
also defines its own compiled components - We’d write this plugin to parse ALL compiled components (from both
@catlaskit
andGira
, and really anywhere) so whenGira
builds their bundle - it extracts ALL compiled components to a CSS file - We would want to build it in such a way so if there were cases it would report failures but not fail the build.
Cool right?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:30
- Comments:8
Top Results From Across the Web
Cascading Style Sheets (CSS) Requirements for RFCs
Cascading Style Sheets (CSS) Requirements for RFCs (RFC 7993, December 2016)
Read more >RFC 7992: HTML Format for RFCs
The CSS will be included in the HTML file but will be described in [RFC7993]. ... tagged in a way that popular search...
Read more >Lee Robinson on Twitter: "Next.js RFC: Global CSS Imports ...
This RFC was proposed because of existing frameworks support for global CSS imports (like CRA). Other frameworks will be able to copy the ......
Read more >Selectors Level 4 - W3C
This module replaces the definitions of and extends the set of selectors defined for CSS in [SELECT] and [CSS21]. Pseudo-element selectors, ...
Read more >hxselect - extract elements or attributes that match ... - Ubuntu Manpage
hxselect reads a well-formed XML document and outputs all elements and attributes that match one of the CSS selectors that are given as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @cloudkite,
Currently it’s planned to only extract to a single, atomic CSS file, with a critical CSS api available for initial SSR. The need for CSS chunks might not be needed - but it’s something we’re open to evaluate down the track 😄.
ah okay
you can keep using the library without CSS extraction 👍 - my advice is if you’re publishing a design system or component library to NPM - don’t extract to CSS yet
in an app that is consuming the design system, or component library, or even just writing their own components - turn on the CSS extraction so you get great performance gains, but still having the same developer experience and behaviour you’re used to when writing CSS-in-JS
it is purely an additive thing however - again completely optional.