-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
custom selector and custom media do not play nice with cascade layers #481
Comments
wow, that's a big question. I'm not sure. On one hand it's like, nope, shouldn't work and the other hand is a big mayybeee? |
Hehe, after typing this up I kept coming back to that :D I think in theory they could work, but them being nested in It will be safest if we keep the current (broken) behaviour and wait until the relevant specs are updated. Forgot to mention that I encountered this with imported styles where it is a bit more unexpected. /* file-alpha.css */
@custom-media --small (min-width: 320px); /* file-beta.css */
@import url(file-alpha.css) layer(media-queries); |
I'm pretty sure we did spec this - but in a short mention nested between examples:
I think that would apply to any sort of custom-property/selector/media at-rules, which are generally name-defining. So that means they should:
|
Thank you @mirisuzanne for finding this issue and sharing this. I've been working on an updated version which ensures this works as you describe : #543 The main issue was that the plugins that handle custom selectors and custom media transformed the CSS before the cascade layers plugin. Resolving this will be part of the upcoming major release of I got side-tracked a bit recently taking on maintenance for the |
@romainmenke Thanks for clarification. Could you give a small update when a fix / next major release could be available? I've to decide if we start using this on a quite big project and if its just about a couple of weeks I would take the risk :) Is this part of your v8 release cause I couldn't find a hint on your project board about that topic. Thanks for your help! |
I am currently working on 1 and 2. |
@romainmenke Thanks for you detailed answer! 🙏🏽 |
This is resolved in the latest pre-release version of |
I want this fix, but I also use
|
@wesleyboar thanks for reaching out!
Clarifying the answer to 1, you should be able to install |
My 2:20-morning brain could not think to install I tried installing the Has my 3:20-morning brain done anything wrong? Source & Config
|
@wesleyboar I don't see anything immediately wrong there but I'm not really familiar with layers @romainmenke can you chime in here? I don't see PS: Thanks a ton for testing the alpha! ❤️ |
I neglected the I'll check whether ——— Update ——— I neglected to enable the cascade-layers plugin.1 After enabling, alpha version, so far, seems to work for my use case. Footnotes
|
Investigating the issue reported by @wesleyboar I noticed that the current fix we implemented for the original issue doesn't work at all. This didn't come up before because at the time of creating that fix it wasn't allowed to nest By running The
We shift the burden from the |
Hi everyone! We have "embedded" support for cascade layers into these plugins. Thank you for all the feedback and insights 🙇 |
I think this behaviour is largely undefined at the moment but declaring custom selectors and custom media inside
@layer
does not work.Should it work?
The text was updated successfully, but these errors were encountered: