SVGIcon — Examples
⇠ Go back to GitHub repositoryGlobal options
Following demonstrates alias settings, it is also possible use removeAlias
and changeOptions
. Changes doesn’t affect already generated icons and the last one isn't testable for style
options (library doesn’t supprot dynamic change).
Simple example
Example without applying any other lib feature
Simple example with styling and alias example
You can use setted alias for 'nice'/'type-saving' icons names and styling with predefined css variable --svg-icon-size
and color
in case your svg icon has setted fill: currentColor
.
More styling example
<svg-icon>
is by default block element with 'width/height' setted to var(--svg-icon-size, 1em)
SVG with multiple colors via CSS vars
This icon has setted colors with: var(--announcements-color1, red)
and var(--announcements-color2, currentColor)
.