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

How to replace css modules classes in js files without a templator #96

Open
aslanovsergey opened this issue Jul 16, 2019 · 1 comment
Open

Comments

@aslanovsergey
Copy link

aslanovsergey commented Jul 16, 2019

Hello,

Could you someone please provide an example how to insert generated modules into js files?
Using docs I built css modules and I saw examples for html and templators but want to keep my js files clean of special template syntax. In my case I'm building React app and when I converted css into modules I updated import in components to import styles from "./MyComponent.module.css"; and class assignment statements <div className={styles.myClass}>. After transpiling it was turned into { className: MyComponent_module_css_1.default.myClass }. What would be the best approach to replace such generated styles or it's done somehow differently?

@aslanovsergey aslanovsergey changed the title How insert css modules in js files How to replace css modules classes in js files without a templator Jul 16, 2019
@AntonGrekov
Copy link

Post title is wrong. He is asking how to use cssmodules in js files wthout templator.
Replacing classes in JS is another task in which i am still very interested.
How to change css-classes in js files ?

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

2 participants