add setting to stop module change class names to BEM style
See original GitHub issue🚀 Feature Proposal
its simple. in my svg file I have:
<g class="rejected-badge"></g>
but in my output I get this:
<g class="MyIconNameComponent__rejected-badge"></g>
could you add option to compile time like native
option so I can set it to not modify my class name to BEM style.
Motivation
I have multiple icon with common class names and I want to add some general style in css file for them
Example
{
test: /\.svg/,
use: [
{
loader: '@svgr/webpack',
options: {
bem: false,
},
},
],
},
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Battling BEM CSS: 10 Common Problems And How To Avoid ...
I believe the double-underscore pattern should appear only once in a selector name. BEM stands for Block__Element–Modifier , not Block__Element ...
Read more >BEM 101 - CSS-Tricks
This is done by appending two hyphens to the name of the block just like btn--orange .
Read more >Naming - BEM
Add modifier classes only to blocks/elements they modify, and keep the original class. Use modifier class name as selector: .block--hidden { } To...
Read more >Using BEM conventions in CSS modules leveraging custom ...
To style our React components we use CSS modules and BEM. There is a nuisance that can be fixed leveraging custom webpack loaders....
Read more >How to Use BEM Methodology - Toptal
If you ever saw a class name like header__form--search , that is BEM in action ... Also, if you want to break your...
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
I came across this same issue when migrating a site from Create React App to Next.js. CRA bundles SVGR in its Webpack setup, whilst Next.js doesn’t. CRA doesn’t rewrite the ids in SVGs loaded this way, so I had a look at their code, and setting it up like that works (ids are not re-written): https://github.com/facebook/create-react-app/blob/main/packages/react-scripts/config/webpack.config.js#L364-L377
.svgo.yml