0

I would like to define 'path/var1.scss' or 'path/var2.scss' filename in my main.scss like a variable. After I would like to use(import) this variable in my main.scss .

//in the main.scss file

$myVariable = "path/var1.scss";

@import $myVariable;

Is it possible? How can achieve it? Many thanks.

alexando
  • 1
  • 1
  • 1
    Possible duplicate of [Import path using variable SASS](https://stackoverflow.com/questions/37568179/import-path-using-variable-sass) – Studio KonKon Dec 10 '18 at 13:01

1 Answers1

-1

In your main.scss, at the top, import your var.scss like this: @import "<relative path to file>" so it will look something like this: @import "../app/scss/var.scss" depending on where the file is situated in your project. Then, after it is imported, you can use the files as you need, for instance: background-color: $pink.

Corné
  • 1,304
  • 3
  • 13
  • 32