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.

Same class names in css in both development and production?

See original GitHub issue

Hello,

I have a question regarding the class names used in development and production.

The documentation (https://material-ui.com/customization/css-in-js/#class-names) says:

Instead, you have to use the classes property of a component to override them. On the other hand, thanks to the non-deterministic nature of our class names, we can implement optimizations for development and production. They are easy to debug in development and as short as possible in production:

development: .MuiAppBar-root-12
production: .jss12
If you don't like this default behavior, you can change it. JSS relies on the concept of class name generator.

How would I get the same behaviour both in development and in production including the html-structure and names for classes easiest? I would be happy to use the short names in development as well for example.

Problem I’m facing is that in development the names and structure is different so as i’m develpoing I always have the check the GUI in both develpoment and production modes (in webpack) which is time consuming and prone to errors.

Thank you for your advice and comments, there probably is something I’m missing here… 😃

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Current Behavior

Steps to Reproduce (for bugs)

Context

Your Environment

Tech Version
Material-UI v1.?.?
React
browser
etc

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Jun 6, 2018

@mikkopori It’s hidding something else. You have a class name generator duplication issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Same class names in css in both development and production?
Hello,. I have a question regarding the class names used in development and production. The documentation (https://material-ui.com/customization ...
Read more >
How to apply CSS style to the different elements having same ...
Approach 1: We will use the CSS class selector followed by the class name to apply the style to the different element having...
Read more >
CSS classnames are being interpreted in a different order in ...
I have a component with several classnames: "x15 x14 login-form__field". In the HTML they are the same order in both environments. In the ......
Read more >
Class selectors - CSS: Cascading Style Sheets | MDN
The CSS class selector matches elements based on the contents of their class attribute.
Read more >
Lesson 1: Understanding ID and Class in CSS
For example, when you added style to the div element that affected all div elements equally. What if you want to stylize some...
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