SVG fontSize sets by default to true and ignore width and height for SVG
See original GitHub issueSVG fontSize sets by default to true and ignore width and height for SVG
- I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
Expected use root overrides style when fonwSize are not provided So I have overrides for MuiSvgIcon
export default theme => ({
root: {
width: 18,
height: 18,
},
})
Current Behavior
But when I use my icon without fontSize props, it steal overrides the root style:
<Add />
Context
Your Environment
Tech | Version |
---|---|
Material-UI | v1.0.0-beta.33 |
React | 16.2 |
browser | Chrome 64 |
etc |
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
SVG fontSize sets by default to true and ignore width and ...
It's already the default behavior of the Icon component. You will still be able to change the size of the icons with the...
Read more >SVG: fixed font size
I have an SVG inlined to html code. Its is scaled to fit width with preserving aspect ratio. Is there a way to...
Read more >font-size - SVG: Scalable Vector Graphics - MDN Web Docs
The font-size attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in...
Read more >Text — SVG 2
When a different font (or change in font size) is specified in the middle of a run of text, the dominant baseline determines...
Read more >Accessible SVGs
Scalable Vector Graphic (SVG) is emerging as the preferred graphic format to use on the web ... We can do this by setting...
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
@palaniichukdmytro Thanks. I confirm the plan change will solve your issue. Basically, we will remove the
fontSize
style to merge it into the root one. The ButtinIcon will apply a font size. Your override will work as expected.As you can see here when I use svg icon itself without fontSize boolean props , it works as expected. But when I wrapped to IconButton the svg inside use fontsize , but I did not provide it https://codesandbox.io/s/jnwrq7zv0v