background-clip property

Angwalt
1 min readJan 24, 2020

--

turning gradients into colors

Linear gradients and radial gradients in CSS have always been a source of much joy but unfortunately they are still not viable values for the color property. As a result it isn’t as easy to have linear or radial gradients as colors in themselves .

Regardless, the CSSbackground clip property enables us to easily make our gradient dreams come true since it enables us to clip the background such that it only covers the areas with text but for this to work the inherent color of the text should be turned off by simply setting the color property to transparent :

color:transparent

And there you have it. Now you can have a linear gradient as a color.

Finally in case you simply can not get the background-clip to work consider using the property -webkit-background-clip and setting it to text. Find a small pen below where you can keep exploring other beautiful gradients.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Angwalt
Angwalt

Written by Angwalt

Just another coder like you

No responses yet

Write a response