How to change jsx className behavior for css-modules
See original GitHub issueI’m trying to alter the behavior of emmet for classes in jsx to use a css module rather than a string:
abr | current | desired |
---|---|---|
div.a |
<div className="a"></div> |
<div className={styles.a}></div> |
However, I can’t seem to figure out how to achieve this. as for as I understand I need a custom filter to do this. and I’m not even sure if custom filters are possible.
Is somebody able to point me in the right direction?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:8 (2 by maintainers)
Top Results From Across the Web
React - how to pass css modules className to a custom ...
What is the expected behaviour? Provided you setup everything correctly this should work. How does your import statement look (the one you ...
Read more >Overriding styles with CSS Modules: Where's my specificity?
This menu component has an outer div, containing three menu items, each with the class item . // Menu.jsx import { item, menu...
Read more >Chainable class names for CSS Modules in React - Sandro Roth
React accepts a single string as className. What if you want to set multiple classes or based on some condition? Let's build a...
Read more >A comprehensive guide to using BEM with React
How to use BEM and CSS Modules together to improve the way you develop React components.
Read more >How to isolate component styles in React using CSS ...
A component is a Javascript function/class, usually written in .jsx files, that manages its state, DOM structure, behaviors, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Any updates on this?
@midgethoen do you fix this in vscode?