question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to change jsx className behavior for css-modules

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

18reactions
wunnlecommented, Jul 31, 2019

Any updates on this?

4reactions
Moretaicommented, Oct 12, 2018

@midgethoen do you fix this in vscode?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found