Styling SVGs with CSS, currentColor Magic & OpenMoji Library Integration
By setting stroke: currentColor; or fill: currentColor; inside inline SVGs, the icon automatically inherits whatever font color is applied to its parent element — including on :hover states!
/* SVG automatically adapts to hover text color */
svg {
stroke: currentColor;
fill: none;
transition: transform 0.2s, stroke 0.2s;
}
button:hover {
color: teal; /* Both text AND icon turn teal instantly! */
}
OpenMoji provides thousands of open-source vector emoji SVGs categorized by standard Unicode hex codepoints. Below are the OpenMoji assets embedded in this demo website:
https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/color/svg/{HEX_CODE}.svg
The clean, geometric outline icons used for the main category cards on this website are from Tabler Icons (100px size, 1px stroke width).
<!-- Tabler Icon standard SVG markup -->
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24"
stroke-width="1" stroke="#000000" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<!-- Path coordinates -->
</svg>