Skip to content
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

Composition support #50

Closed
stevecrozz opened this issue Feb 16, 2023 · 3 comments
Closed

Composition support #50

stevecrozz opened this issue Feb 16, 2023 · 3 comments

Comments

@stevecrozz
Copy link

stevecrozz commented Feb 16, 2023

Is it intended that composition should be supported?

I have tried this syntax, but the property is not part of the generated output:

.myThing {
  padding-left: 25px;
}

.myOtherThing {
  composes: myThing;
}

I am running with the following config:

cssModulesPlugin({
  inject: false,
  v2: true,
})
@angrycat9000
Copy link

Just ran into this issue as well. Had a class that composed a style from another file.

.optionLabel {
  composes: label from "../../style/forms.module.css";
  display: inline-block;
}

When running in Storybook and using webpack to bundle the output included two class names: "SelectPlanSubForm-module__optionLabel___NXcAg forms-module__label___W7Ul5". However when using esbuild and this plugin, only one class name was included: "SelectPlanSubForm-module__optionLabel_x2lRna100". That meant that the element did not recieve any of the styling defined in "forms.module.css"

@mhsdesign
Copy link

Hi ;) i was in need of this feature too as discussed here: #53

but in the end i made my own plugin: https://github.com/mhsdesign/esbuild-plugin-lightningcss-modules

@indooorsman
Copy link
Owner

you can try the dev version by

npm i esbuild-css-modules-plugin@v3-dev

it supports compose & inject but may be buggy since I haven't did full testing 😂 I would really appreciate it if you could try it out and give feedback

@mhsdesign fyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants