Unable to set SCSS variable to CSS variable?

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)