Re: [WICG/webcomponents] Declarative CSS Module Scripts (#939)

Off the top of my head, this provides:

* Reduces repetition of inline styles.
* Properly integrates with the module system.
* Enables avoiding a FUOC.
* Improved perf over today's techniques.
* Actually matches the way people build (and want to build) web components and handle DSD today.
* Provides a more consistent way for all component authors to provide CSS for components.
* Takes an incremental step towards a fully declarative model for web components.
* Brings parity to declarative APIs.
* Brings modularity to CSS, conceptually matching JS Module Declarations.
* Closely aligns with other proposals around HTML modularity.

I believe some use cases have already been listed, but:

* As a component library author, I can distribute the CSS of my design system as a single file to my end users, while my web components and DSD can individually import only the relevant sheets. This can be done uniformly in DSD and imperative code.
* As a site/app dev, I can control how my CSS is bundled and served, making whatever optimizations I need based on my own metrics, without needing to re-architect my components.
* As a framework author, I can perf optimize how CSS resources and DSD are being generated on the fly, based on heuristics and usage patterns.
* As a component author, I can leave CSS completely in the realm of the browser's native code, without needing it to pass into user code, enabling the browser to better optimize my components.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/939#issuecomment-2195532417
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/939/2195532417@github.com>

Received on Thursday, 27 June 2024 19:40:19 UTC