Z
Z
zlodiak2019-08-28 22:13:25
Angular
zlodiak, 2019-08-28 22:13:25

How to import scss file?

Please tell me how can I import a scss file (with variables) into another scss file (with styles). I am using angular8.
My attempt:
1. created a file with scss-vars.scss variables
2. wrote in tsconfig.json:

"@bla/blaa/a/scss-vars": ["libs/ui/scss-vars.scss"],

3. I start the style file with the following import: As a result, I get the following error in the console:
@import "@bla/blaa/a/scss-vars";
Can't find stylesheet to import.

Theoretically, it is possible to hardcode the path, but it seems to me that this is not the best practice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
msdosx86, 2019-09-01
@msdosx86

If your file is in /styles/variables.scss, then
@import 'src/styles/variables'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question