-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cascade Layers #5
Comments
Apologies, I just added an issue template for porposals, which I should have done much earlier. Would you be able to rewrite the issue description to match that template? |
@anttijk @xiaochengh given the ongoing implementation in both WebKit and Blink where these seem to come from, what's the coverage like? AIUI it's good? |
The test coverage looks good to me, other than below:
|
The CSSOM API has just been specified: https://drafts.csswg.org/css-cascade-5/#layer-apis |
CSSOM API tests have been added. Also w3c/csswg-drafts#6323 has been resolved as rejected. So I think the test coverage is complete. |
Thanks @xiaochengh! I think web-platform-tests/wpt#31726 + web-platform-tests/wpt#31823 are the PRs that added the tests, and that it's these two tests: Is that right? |
Exactly! |
A proposed list of tests has been labeled with |
My comments regarding the list:
Other tests look good to me. |
These pass everywhere so I don't see much reason to exclude them, may as demonstrate the edge cases are interoperable.
We should either: simply remove these from interop2022, or make them pass with |
Additionally to the tests mentioned by Xiaocheng, The last case in |
|
Specifically, removes tests which use @Property, @counter-style or @scroll-timeline rules. See web-platform-tests/interop#5 (comment) for more detail.
I've removed the tests in web-platform-tests/wpt-metadata#2492; this doesn't do anything about those with subtests though. |
Description
Cascade Layers provides a powerful way to architect CSS code into “layers”, where the specificity of each layer is calculated independently of other layers — and where the web developer can define which layer will override which.
Specification
Cascade 5
Tests
Current tests
Rationale
Web developers often complain about CSS as a whole, especially about the CSS cascade. They increasingly inline all their CSS via JS, or use a framework of flat classes to style everything. Developers avoid using ID or element selectors, argue about
!important
, and basically try to avoid the CSS Cascade altogether. Cascade layers is recent effort by the CSSWG to fix these pain points for web developers by giving developers more powerful tools to handle complex modern websites. The idea is to lean into a more powerful cascade, instead of avoiding it.Cascade Layers allows developers to create separate “layers” in their cascade — where everything in one layer will “beat” everything in another layer, no matter what the specificity of the code inside each layer. It builds on the way CSS Origins have always worked (where UA styles, User styles, and Author styles have all lived in separate origins – or layers — where specificity is calculated separately).
From the Cascade 5 Specification where Layers is defined:
This is a powerful tool for re-architecting how a project’s CSS is structured that will not be useful until it’s in all browsers. Cascade Layers cannot be progressively enhanced or polyfilled client-side.
It’s also an example of a technology that’s well underway — all three engines have implementations behind a flag in preview browsers.
Cascade Layers will benefit from being included in Interop 2022, where extra attention to cross-browser testing will make sure the implementations are thoroughly interoperable.
The text was updated successfully, but these errors were encountered: