Home > Enterprise >  Why is 'text' not appearing as an option for background-clip in VS Code?
Why is 'text' not appearing as an option for background-clip in VS Code?

Time:11-10

I'm trying to make a heading which has a gradient colour. I've found how to do this online by using '''background-clip: text;'''

However when I try to do this my VS Code does not show a "text" option for background-clip. See below: VS Code options for background-clip

Why is this not an option for me?

CodePudding user response:

This article helps with explaining it more. Scroll down to the text heading where you can read more about it. It does work, just not how it used to.

.background-clip-text {
  
  /* if we can clip, do it */
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;

  /* what will show through the text
      ~ or ~
     what will be the background of that element */
  background: whatever;

  /* fallback text color
      ~ or ~
     the actual color of text, so it better work on the background */
  color: red;
 
}

In order for this to work properly, you will need to apply -webkit-text-fill-color: transparent; to the element you want this style on.

  • Related