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
  • 245,468
  • 26
  • 309
  • 415
ban_javascript
  • 339
  • 1
  • 4
  • 16

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
  • 400
  • 5
  • 20