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.
Adds explicit
px
units to allwidth
andheight
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 thewidth
andheight
attributes are really only here as a fallback for older browsers that support SVG but don't supportviewBox
. 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.