lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Add class names transform like localsConvention in postcss-module

Open pont1s opened this issue 2 years ago • 1 comments

Hello!

I would like to be able to convert class names for easy use in JS, like is done in postcss-module (https://github.com/madyankin/postcss-modules#localsconvention).

For example source file button.css:

.button-base {
  display: flex;
  background-color: red;
}

Style of exported classnames with localsConvention: camelCaseOnly:

export default {
    "buttonBase": "TBVvba-button-base"
};

Thanks.

pont1s avatar Nov 22 '23 19:11 pont1s

This would be really helpful.

@devongovett if you have any pointers on how you would like this implemented, and which dependency for the case-conversion you would like to use, I will be happy to create a PR.

marlonbaeten avatar Apr 14 '25 08:04 marlonbaeten