-
Notifications
You must be signed in to change notification settings - Fork 92
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
Feature request: Support for cascade layers #205
Comments
Interesting! My first thought was that we already have "layers" since nesting is one of the huge features of Garden (although it is also now included in CSS proper). But then I read your link and saw that this is about a new sort of selector. Can you help teach why this would be desirable instead of, eg, principled nesting/variables that are so easy in what Garned users have? Perhaps a (psuedo-code) example?
|
Let's say my site uses some 3rd party CSS framework as a base style. In this framework, there is a selector which adds a style for list items with links: .list > li > a {
color: red;
} Now I want to override this style in my application code and turn the color into .blue {
color: blue;
} However, if I attach this Cascade layers could make this process much simpler. I could wrap all the framework specific code into "framework" layer like so: @layer framework {
.list > li > a {
color: red;
}
} Then I would wrap all my application code into its own "application" layer (i.e. I would use the @layer application {
.blue {
color: blue;
}
} Now my |
To add to this discussion. Here is a CSS snippet from a project I'm working on. It simply describes the layer hierarchy. Anything defined on a layer to the right will override something in the layer to the left. @layer reset, globals, layout, components, partials, utilities; |
Hi
Modern CSS supports cascade layers that are useful for example overriding framework specific styles: https://developer.chrome.com/blog/cascade-layers/
I wonder if there is a support coming for this in Garden? Something like
at-layer
could be a reasonable way to implement this.The text was updated successfully, but these errors were encountered: