question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: CSS extraction

See original GitHub issue

Main 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 and Gira, and really anywhere) so when Gira 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:closed
  • Created 4 years ago
  • Reactions:30
  • Comments:8

github_iconTop GitHub Comments

3reactions
itsdougescommented, Feb 10, 2021

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 😄.

3reactions
itsdougescommented, Jan 3, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found