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

Optimize Prism logo #990

Merged
merged 1 commit into from
Jul 14, 2016
Merged

Optimize Prism logo #990

merged 1 commit into from
Jul 14, 2016

Conversation

valtlai
Copy link
Contributor

@valtlai valtlai commented Jun 30, 2016

Optimizations to Prism SVG logo:
– remove XML prolog
– remove version attribute (doesn’t have any effect)
– remove unused xlink namespace
– remove viewBox attribute (doesn’t have any effect in this context)
– remove px units (plain numbers are pixels)
– optimize path data

Optimizations to Prism SVG logo:
– remove XML prolog
– remove `version` attribute (doesn’t have any effect)
– remove unused `xlink` namespace
– remove `viewBox` attribute (doesn’t have any effect in this context)
– remove `px` units (it’s default unit)
– optimize path data
@Golmote
Copy link
Contributor

Golmote commented Jul 14, 2016

Looks good to me ;) Thanks for contributing!

@Golmote Golmote merged commit f69e570 into PrismJS:gh-pages Jul 14, 2016
@LeaVerou
Copy link
Member

Please add viewBox back. Every SVG should have a viewBox. @svgeesus can explain why.

@valtlai
Copy link
Contributor Author

valtlai commented Jul 19, 2016

@LeaVerou, see #1002.

@valtlai
Copy link
Contributor Author

valtlai commented Jul 22, 2016

Every SVG should have a viewBox. @svgeesus can explain why.

@svgeesus, I’m very interested to know why.

@svgeesus
Copy link

The width and height attributes make an SVG image non-scalable. Unless it is desired to always force a specific size, they should not be present.
A viewbox specified the range of world coordinates used. In this case, the range started at 0,0 (which is the default if viewBox is not specified) and extends to the same numbers as the width and height attributes (whichis why removing the viewBox was successful in this instance). However, it still forces a fixed size rather than being, well, scalable.
Using a viewBox (and no width or height) allows the logo to be used at different sizes. See #1005

Also see
https://www.w3.org/TR/SVG2/coords.html#ViewBoxAttribute
for the more complex cases, in which width/height and viewBox are not providing essentially the same info.

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

Successfully merging this pull request may close these issues.

4 participants