-
Notifications
You must be signed in to change notification settings - Fork 174
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
[Bug]: &
operator is not working in less module
#4405
Comments
I think it's a problem cause by lightingcss, which is used by rsbuild. If I don't use the lightingcss-loader, the result is ok. |
@GiveMe-A-Name Can you take a look at this lightningcss related issue? |
The css is not validate css by transform by less-loader, So lightningcss can't transform the css code correctly, lightningcss playground .test {
background-color: rebeccapurple;
}
:global(.hello) {
background-color: aqua;
&-world {
background-color: brown;
}
} After less-loader, the css will become: .test {
background-color: rebeccapurple;
}
:global(.hello) {
background-color: aqua;
}
/* invalidate */
:global(.hello)-world {
background-color: brown;
} |
I think is not a bug in lightningcss, but recover error css can be lightningcss feature. |
Yes, it's not a valid css, but it's valid less style, which is parent selector. |
Yes, but Less only transform the less code by replacing |
Version
Details
This is the original code of less.
When I used the
&
operator, the built output did not include the class modified by&
. The output is:Reproduce link
https://codesandbox.io/p/github/gz65555/rsbuild-less-bug-feedback/main?import=true
Reproduce Steps
pnpm i & pnpm build
You can see there is no
.hello-world
class hereThe text was updated successfully, but these errors were encountered: