0

I have a color defined rgba()-defined CSS variable.

--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, 0.2);

I want to use this for text, but I need to change the alpha part so the resulting text would have same RGB, but opacity of 0.7.

I've tried:

.my-text {
  color: var(--vscode-diffEditor-insertedTextBackground);
  opacity: 0.7;
}

As well as

.my-text {
  color: rgb(var(--vscode-diffEditor-insertedTextBackground), 0.7);
}

But it wont work or results into resetting a color to default. I'm using pure CSS (no pre-processing) and I'd prefer no JS here.

Sergei Klinov
  • 730
  • 2
  • 12
  • 25

0 Answers0