Comment

Comment by afloatboat

SVG elements also support currentColor for the fill property, which is linked to CSS’s color property.

<svg><path d=“” fill=“currentColor” /></svg>

element { color: hsl(0 0% 0%) }

One advantage is that you can target the parent element and the SVG will change automatically.

You can also create multiple “shades” by having currentColor on multiple paths with different opacity.

parent afloatboat 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton