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.

Changing the default format of classnames assigned to CSS modules

See original GitHub issue

Is there any way to change the default format of the classnames for the imported CSS modules without ejecting? Sorry if there’s already a question regarding this. I tried searching for it in the issues.

I’m talking about this [filename]\_[classname]\_\_[hash] written here

$ create-react-app --version

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

Timercommented, Oct 23, 2018

Ah, yeah we don’t let you change it. You can eject if you feel strongly, but I’d advise against it because no one ever sees them (you don’t even need to see them unless you’re inspecting something).

sky93commented, Oct 27, 2018

It would be great if create-react-app also supported [hash] format in CSS Modules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

using css modules how do I define more than one style name
You can add multiple classes using css modules as follows: className={`${styles.description} ${styles.yellow}`}. e.g.
Read more >
Using CSS Modules in React - OpenReplay Blog
A different way to work with CSS styling in React apps. ... You only need to change the CSS file name to “[filename].Modules.css”;...
Read more >
Seamless mapping of class names to CSS modules inside of ...
Default : throw . Defines the desired action when styleName cannot be mapped to an existing CSS Module. Available options: throw throws an...
Read more >
What are CSS Modules and why do we need them?
According to the repo, CSS modules are: CSS files in which all class names and animation names are scoped locally by default. So...
Read more >
A deep dive into CSS Module - LogRocket Blog
According to the official CSS Module GitHub repository, a CSS Module is a CSS file in which all class names and animation names...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found