Intent to Prototype: @scope

364 views
Skip to first unread message

Anders Hartvoll Ruud

unread,
Mar 25, 2022, 9:37:34 AMMar 25
to blink-dev

Contact emails

and...@chromium.org

Explainer

https://css.oddbird.net/scope/explainer/

Specification

https://drafts.csswg.org/css-cascade-6/#scope-atrule

Summary

Allows authors to scope style rules to a given element. The key difference between this and a regular descendant combinator is that the "scoping proximity" cascade criterion is applied to the style rules, which makes it possible to weigh the priority of declarations according to the distance to a given scoping root.



Blink component

Blink>CSS

Motivation

https://css.oddbird.net/scope/explainer/#goals



Initial public proposal



TAG review

https://github.com/w3ctag/design-reviews/issues/593

TAG review status

Issues open

Risks



Interoperability and Compatibility



Gecko: Just filed :https://github.com/mozilla/standards-positions/issues/625

WebKit: E-mail sent to webkit-dev.

Web developers: No signals

Other signals:

WebView Application Risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?



Debuggability

The style rules inside @scope will automatically appear in DevTools, but the @scope-context will be lost. We'll need to add special support to surface that.



Is this feature fully tested by web-platform-tests?

No

Flag name

CSSScope (Probably)

Requires code in //chrome?

False

Tracking bug

https://crbug.com/1280240

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5100672734199808

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages