Re: [csswg-drafts] Proposal: CSS @sheet (#11509)

@robglidden  - 

> Correct?

Yes, that all looks correct to me.

> And if I want a style element (rules outside of sheets) to be available to be referenced in a shadow root but not automatically applied in the light DOM, I would just https://github.com/whatwg/html/issues/10710#issuecomment-2460651361 <style disabled>?

`disabled` also means disabled in the shadow root, so this current proposal requires the usage of `@sheet` for defining styles but not applying them. 

> And doesn't this in essence potentially address the https://github.com/whatwg/html/issues/10673#issuecomment-2460519693 https://github.com/whatwg/html/issues/10673#issuecomment-2392517468 of the Declarative CSS Module proposal https://github.com/whatwg/html/issues/10673, opening a syntax alignment path to merge some or all of the functionality of the two proposals?

Yes, `@sheet` provides a clear separation between the definition and application of styles. Agreed that both proposals can address sharing styles with Shadow DOM - we were directed towards using `@sheet` from the TAG review:  "To allow these styles to be defined inline, [@sheet](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#sheet) seems like a better solution." https://github.com/w3ctag/design-reviews/issues/1000#issuecomment-2433471327

> Otherwise, for both cases, particularly when the links are repeated in multiple shadow trees, it seems there will still be an [unspecified and browser-specific reliance on caching for implementation that can produce FOUC](https://issues.chromium.org/issues/383593251).

This won't change the underlying caching behavior for external files, but one of the reasons we're so interested in inline style definitions is to avoid this type of FOUC.

-- 
GitHub Notification of comment by KurtCattiSchmidt
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11509#issuecomment-2641418282 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 7 February 2025 00:04:02 UTC