-
-
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
CSS with extensions not correctly transforming #738
Comments
@wesleyboar I've taken your report and created a separate issue to keep the other thread on topic. Can you verify a few things? What is the output without This in your /*! core-styles.base.css */
@import url("./components/c-button.css"); What is the version of
|
Okay. Yes. The output—sans cascade-layers, with import—is correct custom-selectors parsing.Input
Output
My cascade-layers is at v2.0.0.
|
Unminified output : .c-button {
border-style: solid;
border-width: var(--global-border-width--normal);
box-sizing: border-box;
display: inline-block
}
.c-button:not(:is(:disabled, [disabled])) {
cursor: pointer
} 🤔 Something is indeed not working here but I can't reproduce it within our repo. UPDATE : I did not notice the plugin options before, that explains why I couldn't reproduce. /* styles.css (entrypoint) */
@import url(./imports/extensions.css) layer(extensions);
@import url(./imports/components.css) layer(components); /* extensions.css */
@custom-media --dark (prefers-color-scheme: dark);
@custom-media --light (prefers-color-scheme: light);
@custom-media --tablet (width >= 768px);
@custom-selector :--h h1, h2, h3, h4, h5, h6;
@custom-selector :--button button, input[type="submit"];
:root {
--color-red: red;
--color-blue: blue;
} /* components.css */
:--button {
color: var(--color-red);
}
@media (--dark) {
:--button {
color: var(--color-blue);
}
} Becomes : :root {
--color-red: red;
--color-blue: blue;
}
button:not(.does-not-exist):not(#\#) {
color: red;
color: var(--color-red);
}
input[type="submit"]:not(#\#) {
color: red;
color: var(--color-red);
}
@media (prefers-color-scheme: dark) {
button:not(.does-not-exist):not(#\#) {
color: blue;
color: var(--color-blue);
}
input[type="submit"]:not(#\#) {
color: blue;
color: var(--color-blue);
}
} All extensions resolved correctly :
I am currently working a fix for the interaction with CSS Nesting so maybe that one also fixes this issue? Alternatively it would be best to have a minimal reproduction. |
Nevermind, I noticed what is happening :)
You have disabled all features except those three. It is currently the Cascade Layers plugin which removes all Since you disabled
This change will allow your setup to work. |
I agree. I want to provide a minimal reproduction. I might make one later today. Thanks for showing your input and output. Note to Self
|
Oh, indeed. I will activate it, and cross all of my fingers. |
Activating the plugin works. 😅 I consider this issue resolved. Thanks. |
We have also made the needed code changes so that the plugins for These changes will be shipped in upcoming released. |
I tried installing the
betaalpha andpostcss-env-function
. I do not see the fix succeed.Has my 3:20-morning brain done anything wrong?
Source & Config
package.json
(abbreviated)No
dependencies
. Long story. Temporary. Does it matter?npm list
src/.postcssrc.yml
src/.../c-button.css
No
@import
✓ The
@custom-selector
is parsed away.dist/c-button.css
Use
@import
ⓧ The
@custom-selector
remains, unparsed.src/.../core-styles.base.css
dist/core-styles.base.css
Originally posted by @wesleyboar in #481 (comment)
The text was updated successfully, but these errors were encountered: