Search code examples
variablessassforward

Sass @forward prefix with variables is not work


Hi i have a problem about Sass @forward. Problem is when i try @forward prefix with variables it is not work. example:

@forward 'color.scss' as red-*;
$black:#000;
@use 'forward' as f;
body{
background-color:f.red-$black;
}

Solution

  • Forwarding prefixes are applied after the $. Docs: https://sass-lang.com/documentation/at-rules/forward#adding-a-prefix

    body {
        background-color: f.$red-black;
    }