I can`t delete prefix in className in svg
See original GitHub issueHow I understand, @svgr/webpack add prefix (name of svg) for className (for React Project). For example, if my svg named ‘name1.svg’ and had class=“class1”, in browser I see className=“name1_class1”. I want delete prefix and I try use svgo plugin options:
test: /\.svg$/,
include: PATHS.images,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [{
prefixIds: false
}]
}
}
}]
Also I use another options:
test: /\.svg$/,
include: PATHS.images,
use: [{
loader: '@svgr/webpack',
options: {
svgoConfig: {
plugins: [{
cleanupIDs: {
prefix: ''
}
}]
}
}
}]
But it doesn`t work. Please, help me how delete a prefix for className
“@svgr/webpack”: “^5.2.0”, “webpack”: “^4.41.5”,
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
prefix problem
I want my class name to match the name of the svg file(icon-graphic-phone). In the app is there a way to remove the...
Read more >Unable to change class name of SVG element
In HTML, className is a string. In SVG it is an SVGAnimatedString object. That's why you can't just do svgElement.className = "halffill" ....
Read more >Control of SVG <style> class names on Export
If I want several related/similar SVG files to use the same script or css, I can't be sure that the class name that...
Read more >Specify CSS class names on SVG paths using Illustrator
I can't get illustrator to export with ID's, or classes's. I prefer to code my SVG's though, as odd as that sounds, and...
Read more >fortawesome/fontawesome-svg-core Code Examples
createElement('button'); geolocationButton.classList = 'btn btn-danger btn-sm'; // Set icon const iconDef = findIconDefinition({prefix ...
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
This is the correct config that eventually worked for me, with the mention that I am using NextJS, so the following snippet is part of my
next.config.js
file.let me show you the direct code