DEV Community

Cover image for Using the currentColor property to change SVG color
SnippFlow
SnippFlow

Posted on β€’ Edited on

Using the currentColor property to change SVG color

The currentColor is used in CSS to inherit the text color to other properties like fill and stroke in SVG. This way you can change the color of an entire SVG element by changing the text color.

See the following Codepen for a demo:

Full article: Using the currentColor property to change SVG color
CSS Snippets

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay