Same class names in css in both development and production?
See original GitHub issueHello,
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:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
@mikkopori I’m not sure I can help more than linking: https://material-ui.com/getting-started/faq/#how-to-fix-a-class-names-production-build-conflict-
@mikkopori It’s hidding something else. You have a class name generator duplication issue.