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

[Feature] Add ability to transform a selection of class names #147

Open
GideonMax opened this issue Dec 19, 2022 · 0 comments
Open

[Feature] Add ability to transform a selection of class names #147

GideonMax opened this issue Dec 19, 2022 · 0 comments

Comments

@GideonMax
Copy link

Currently, all class names get transformed.
My problem is that some libraries expect you to modify a component's children's css using their classes, which I can't do with css modules rn as they get transformed.

Solution:
Add an option, which can be set either through the plugin's settings or per individual file (using a comment), which either:
a. explicitly states which class names should be transformed
b. declares that only the first class in every declaration shall be transformed

example for option a:

/*module-transform: class-a class-d*/
.class-a .class-b{
  color: red;
}
.class-c .class-d{
  color: blue;
}

will result in

.class-a-*** .class-b{
  color:red
}
.class-c .class-d-***{
  color:blue;
}

example for option b:

/*module-transform-first*/
.class-a .class-b{
  color: red;
}
.class-c .class-d{
  color: blue;
}

will result in

.class-a-*** .class-b{
  color: red;
}
.class-c-*** .class-d{
  color: blue;
}
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

1 participant