0

Is it possible to combine a variable with another if it's from a different selector?

Some thing like this?

:root {
    --shadow: 1px 1px var(--color);
}
.blue {
    --color: blue;
    text-shadow: var(--shadow);
}
.red {
    --color: red;
    text-shadow: var(--shadow);
}
Temani Afif
  • 211,628
  • 17
  • 234
  • 311
ban_javascript
  • 157
  • 1
  • 5
  • 12

1 Answers1

-1

You can do this simply by using Sass

Example:

$color: #c6538c;

$shadow: 1px 1px $color;

Check https://sass-lang.com/documentation for more.

Tedajo Philippe
  • 360
  • 3
  • 18