Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Remove overflow property where it has no effect #73

Closed
slyrz opened this issue Jan 21, 2017 · 8 comments
Closed

Remove overflow property where it has no effect #73

slyrz opened this issue Jan 21, 2017 · 8 comments

Comments

@slyrz
Copy link

slyrz commented Jan 21, 2017

Right now svgcleaner keeps overflow properties in the SVG files untouched. They can be removed for all elements that don't establish new viewports.

Scour removes the overflow-property like this. The first if-case is probably the most effective one. At least I have SVGs where Inkscape added unnecessary overflow:visible styles to all my path elements.

@RazrFalcon
Copy link
Owner

Yeap, it's not implemented yet, because, as you can see in the spec, the definition of the overflow is pretty big. Lots of edge cases.

@slyrz
Copy link
Author

slyrz commented Jan 21, 2017

Yes, and frankly, I think it's futile to implement anything of that spec besides the first bullet point. Too much work for little reward. I can't test it at the moment, but I think Inkscape adds the CSS style overflow:visible to all shapes and paths by default. Removing these would be a big win. I can make a PR if you want.

@RazrFalcon
Copy link
Owner

RazrFalcon commented Jan 21, 2017

Well, removing only overflow:visible is easy. I wanted to implement the overflow completely. I'll look into it.

Thanks for PR, but problem not in the implementation, but in the testing. I bet that something will went wrong.

@slyrz
Copy link
Author

slyrz commented Jan 21, 2017

Okay then, I didn't know you had the removal of the overflow property planned already. I just noticed it today after I tried to clean some Inkscape files and thought I should open an issue. For me this isn't a high priority issue, as a simple sed 's/overflow:visible;//g' helps me to get rid of the property without breaking my SVGs.

@RazrFalcon
Copy link
Owner

Well, simple regex will not work in a wild. =)

Yes, there are lots of ideas. You can also grep sources for TODO. But still any ideas are welcome.

@RazrFalcon
Copy link
Owner

Done. Check it out.

@slyrz
Copy link
Author

slyrz commented Jan 24, 2017

Works great, all the overflows are gone!

@RazrFalcon
Copy link
Owner

Great.

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

No branches or pull requests

2 participants