Class names are getting changed. I need them to remain the same.
See original GitHub issue💬 Questions and Help
I am importing several svgs into my project using svgr. Every svg file has classes called icon-fill
or icon-stroke
that allows them to be colored appropriately.
Somewhere else in my project I have this css set:
.icon-stroke {
stroke: currentColor;
}
.icon-fill {
fill: currentColor;
}
This makes the icons all correctly inherit the color
property of their parent.
The problem
is that all the class names in my svgs are getting changed to have the file name prepended to the class name.
For example, one of the file names is ChevronLeft.svg
so the class name is getting rewritten to ChevronLeft_svg__icon-fill
. This is causing my svgs to no longer be colored correctly.
I have looked through the docs and I do not see a way to turn this off.
Is there a way I can fix this so that the class names are left as is?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to change the name appearing in the class room?
My child has logged into classrom through my google account. My google id and photo is appearing in the class room. How to...
Read more >css - class overrule when two classes assigned to one div
Multiple classes can be assigned to a div. Just separate them in the class name with spaces like this: <div class="rule1 rule2 ...
Read more >Change Class Names Of Multiple Divs With Same ... - SitePoint
Hi, I have a situation where PHP is creating a document that has code blocks that contain the same class names each time...
Read more >CSS Class Names to Prevent Refactoring - Sparkbox
This is because we can't predict the future. A class name might make perfect sense one day, then the design changes, and it's...
Read more >Possibly class name change over time. What approach to take?
But on your original point, businesses and requirements change. Therefore, so can code. It's entirely acceptable to rename classes and methods if logic...
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
To clarify,
noSvgo: false
is not correct.svgo: false
is.@guillaumebrunerie Thanks for pointing that out, For anyone else who comes upon this, it was tricky to figure out how to actually apply it.
For example:
Does not work. I have also tried
'--no-svgo': true
and'no-svgo': true
here.I also tried adding this to my project root
Also tried adding this to my package.json:
None of the above worked, however this did (added to project root):