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

Useless 0h24v24H0V0z path? #327

Open
paulirish opened this issue Sep 25, 2021 · 2 comments
Open

Useless 0h24v24H0V0z path? #327

paulirish opened this issue Sep 25, 2021 · 2 comments

Comments

@paulirish
Copy link

My typical SVG workflow is taking icons from material icons, sending them through svgomg, and then inlining them into my css.

One little bit of SVG I see in all these icons (and I think I also see in all illustrator-sourced svgs..) is this element:

<path d="M0 0h24v24H0V0z" fill="none"/>

I don't speak path, so I don't know what it does. But I do know that whenever I've removed it over the past few years, everything is fine.

Can anyone that knows path syntax explain its purpose?
And it is indeed useless, then perhaps svgo and svgomg could strip it?

@jakearchibald
Copy link
Owner

It draws 24x24 box, but since it has no fill, there's nothing to render.

I don't know why material icons have this, but I've seen it too.

@TrySound I guess the answer is a plugin that removes paths that don't have a fill or stroke?

@Windowsfreak
Copy link

I believe that it is used by some design software to ensure the viewport doesn't accidentally get changed, by drawing an invisible rectangle covering it. As SVGOMG also removes the viewport by default, you should test thoroughly if removing both of it breaks your downline applications.

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

3 participants