Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invisible background fillings are required? #1833

Open
sator-imaging opened this issue Nov 8, 2024 · 1 comment
Open

Invisible background fillings are required? #1833

sator-imaging opened this issue Nov 8, 2024 · 1 comment

Comments

@sator-imaging
Copy link

Hi there,
I realize that material icons SVG has invisible background that is same size to View Box. I'm not sure is there any reason to draw them?

--

I've tried to remove it by programmatically for my use but it's so hard. there are many patterns...

# most simple, easily removed by code --> av\volume_down_alt\materialicons\24px.svg
<rect fill="none" height="24" width="24"/>

# some rect has 'x' and/or 'y' attribute --> av\volume_down_alt\materialicons\20px.svg
<rect fill="none" height="20" width="20" x="0"/>

# draw rect by path, simple --> av/videocam/materialicons/24px.svg
<path d="M0 0h24v24H0V0z" fill="none"/>

# some icon draws path from other than top-left corner, and what's this magic number 0.87?
# --> navigation\unfold_less\materialiconstwotone\24px.svg
<path d="M24 0v24H0V0h24z" fill="none" opacity=".87"/>

# drawing rect twice? --> hardware\keyboard\materialiconssharp\24px.svg
<path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none"/>

# and more patterns, some icon using style instead of fill attribute
<rect style="fill:none" .../>
@omkarkulkarni2704
Copy link

@sator-imaging Exactly! These extra elements help ensure icons display consistently across different screen resolutions and use cases. Tools like SVGO can streamline this process by removing redundant parts, or you can use XML parsing libraries to programmatically clean up SVGs by targeting specific elements like and with fill="none".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants