mozilla / protocol-assets

Design assets for Protocol, Mozilla’s design system.
https://protocol.mozilla.org/
Mozilla Public License 2.0
11 stars 8 forks source link

Add px units to width and height attributes #48

Closed craigcook closed 3 years ago

craigcook commented 3 years ago

Adds explicit px units to all width and height attributes that were lacking them. From my (limited, possibly mistaken) understanding of the SVG specs, a unitless value is a conceptual "user unit" which in web browsers is calculated as CSS pixels. So technically unitless values are valid and render as pixels anyway, but declaring a unit explicitly eliminates any ambiguity.

I think unitless values in viewBox are preferable because it's tailor made for scaling (they're still pixels in browsers anyway), but the width and height attributes are really only here as a fallback for older browsers that support SVG but don't support viewBox. It gives these images a "native" size so those browsers don't render them at 300 x 150 by default, and my gut says being explicit with pixels may be more compatible with those old browsers anyway.

tl;dr: this isn't really necessary but kinda feels right? I dunno, it's like, whatever, man.

craigcook commented 3 years ago

Meh, not worth it.