We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to use composes with multiple class levels, but it's working for part of my need.
composes
My project is configured with vite and lightningcss.
vite
lightningcss
I have the following scenario:
component.module.css
.classA { composes: fontSizes--headingMedium from global; background-color: magenta; } .classB { composes: classA from '.'; text-align: center; } .myComponentClass { composes: classB from '.'; border: solid 1px red; }
theme.css
App.tsx
.fontWeights--bold { font-family: Arial, sans-serif, NunitoSans-Bold; font-weight: bold; } .fontSizes--headingMedium { composes: fontWeights--bold from '.'; font-size: 24px; line-height: 24px; letter-spacing: 0; }
So, note that the composes: fontWeights--bold from '.'; was ignored by the css-modules transpilation.
composes: fontWeights--bold from '.';
What I'm doing wrong?
Reproducible example: https://codesandbox.io/p/sandbox/lightningcss-css-modules-composition-demo-6k9x67
The text was updated successfully, but these errors were encountered:
The most strange part, is that if I remove from '.'; from the local classes, the result is even worse:
from '.';
.classA { composes: fontSizes--headingMedium from global; background-color: magenta; } .classB { composes: classA; text-align: center; } .myComponentClass { composes: classB; border: solid 1px red; }
Note that the classA was completely ignored.
classA
Sorry, something went wrong.
Sorry, I think that I need to open this issue in the lightningcss GitHub, right?
No branches or pull requests
I'm trying to use
composes
with multiple class levels, but it's working for part of my need.My project is configured with
vite
andlightningcss
.I have the following scenario:
component.module.css
theme.css
(imported globally in myApp.tsx
)Result appearance
Result HTML
Result CSS
So, note that the
composes: fontWeights--bold from '.';
was ignored by the css-modules transpilation.What I'm doing wrong?
Reproducible example: https://codesandbox.io/p/sandbox/lightningcss-css-modules-composition-demo-6k9x67
The text was updated successfully, but these errors were encountered: