Just use string interpolation:
$color-black: #000000;
body {
--color: #{$color-black};
}
Apparently the old behaviour is not intended and violated the language specs of SASS:
- CSS variables mixed with SCSS variables don’t emit proper CSS in 4.8+
- CSS variables aren’t properly compiled
- Assigning SASS variables to CSS Variables (Custom Properties) no longer works