viewbox
is good enoughviewbox
.
style="width: 100%; padding-bottom: 66.67%; height: 1px;
overflow: visible"
viewbox="0 0 900 600"
and preserveAspectRatio="xMidYMin
slice"
preserveAspectRatio="xMidYMid meet"
is default
meet
is equivalent to
background-size:contain;
slice
is equivalent to
background-size:cover;
img[src="plus.svg"]
a.twitter
background-image()
twitter.svg
has no fill and the fill color is black by defaultbrightness(0) saturate(100%)
to filter
to always convert any color to black and then do the filtering above to convert to the target colorstyle
tags in sprite.svg
and overwrite style using svg.svg--plus-dims
svg.icon-goldstar { fill: gold; stroke: currentColor; /* take the font color */ stroke-width: 5%; stroke-linejoin: round; }
fill="currentColor"
../assets/img/sprite.svg#plus
svg use
svg4everybody.min.js
and svg.js
with defer
style
tag inside
each symbol
in sprite.svg
is lost.
use[xlink:href="#a--minus"]
style
in each symbol
is kept.
symbol
can't be loaded in CSS background
g
instead of symbol