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 obfuscating css classes ?

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

i want to obfuscating Material UI classes names

Examples 🌈

.MuiAppBar-root => .pxcHI .MuiToolbar-root => .dgSjX … something like google obfuscating : 1_Yw81nmIkrXdwhscxDmTf2Q

My Solution

i use rewire to overwrite create-react-app webpack configs by add this code:

...
config.module.rules.push( {
    test: /\.css$/i,
    loader: 'css-loader',
    options: {
        modules: {
            localIdentName: '[sha1:hash:hex:5]',
        },
    },
})
...

it’s work for my custom css files but not effected on Material UI classes names i just want to know how to config webpack to overwriteing material ui classes names and obfuscating theme?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Jun 6, 2020

@AkramiPro You can write a JSS plugin for doing such, see #19455.

0reactions
cc-greglorenzencommented, Feb 1, 2022

Is there an update on whether or not the JSS plugin overrides work with MUI 5? I have a similar issue as @dictor93 and need to increase the specificity to override default site styling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML/CSS Obfuscation Compiling - Stack Overflow
Is there a way to take my HTML/CSS file and process it in a way that it will take original class names/ids in...
Read more >
How to obfuscate CSS class names with React and Webpack
modules property tells Webpack that class names needs to be obfuscated. You can set it to false in dev build and class names...
Read more >
CSS Obfuscator - Protect Your Stylesheets
CSS Obfuscator is an unique way to protect your stylesheets from theft. Actually, it doesn't protects sheets from stealing, because it's not really...
Read more >
Is there a way to obfuscate CSS classes on production ...
Is there a way to obfuscate CSS classes on production environment? ... I'm not using CSS Modules, just global imports of sass files....
Read more >
What does Google use to obfuscate their CSS selectors, and ...
Closure Stylesheets makes it possible to rename CSS class names in the generated stylesheet, which helps reduce the size of the CSS that...
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