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.

SVG fontSize sets by default to true and ignore width and height for SVG

See original GitHub issue

SVG 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 />

screenshot_2

Context

Your Environment

Tech Version
Material-UI v1.0.0-beta.33
React 16.2
browser Chrome 64
etc

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Feb 19, 2018

@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.

0reactions
palaniichukdmytrocommented, Feb 19, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

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