-
Notifications
You must be signed in to change notification settings - Fork 413
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
Linaria 6: broken :global selector (regression) #1388
Comments
PS: same problem with |
BTW this is the reason why Linaria's own website looks a bit off https://linaria.dev |
This isn't really a regression, rather it's a breaking change in v6. It's because of stylis v4, see #1373 The new behavior matches SCSS and other preprocessors. Linaria was previously an outlier, and anyone migrating had to change their nested selectors. |
I confirm that the documented |
I'm finding the same thing. It seems Linaria or wyw-in-js needs an adjustment to enable global styles with Stylis v4, but I haven't yet traced the code to understand how it is intended to work. |
So it appears that we need the When I add it to wyw like this:
then Unfortunately the code for the namespace middleware is questionable at best. It might be faster to come up with a new replacement middleware than to debug it. |
Any update or plan to tackle this issue? |
I kinda agree with
However, the issue with I will work on the plugin to stylis as |
The fix was done in Anber/wyw-in-js#37 and released in |
@layershifter Thanks for your fix! But I see another problem with :global If i do const globals = css`
:global() {
body {
.someClassName {
color: red;
}
}
}
` then I get the error If i do const globals = css`
:global() {
body.someClassName {
color: red;
}
}
` then no error. It's not a big problem, but before version 6 it worked this way and that way. |
@Dozalex seems that my change should be improved 🤔 I will try to fix it next week until somebody will do it earlier 🐱 |
can we just have a |
Environment
Linaria version: 6
Bundler: Webpack 5
Description
Original question: "Linaria 6: space between classname and pseudo element selector (regression)", rephrased based on answers, see below.
This code generates a class name with an unwanted space:
.dhnsy8v ::after {
The expected behaviour is no space between classname and ::after
Reproducible Demo
https://stackblitz.com/edit/linaria-bug-y4gxid?file=src%2FTitle.tsx
&::after { ... }
The text was updated successfully, but these errors were encountered: