Answer the question
In order to leave comments, you need to log in
How to correctly include variables in several files?
Tell me how to use variables if I want to make styles for individual blocks in separate files, like this:
/scss /*папка стилей*/
- main.scss /* главный файл стилей куда подключаю все остальные стили для блоков*/
- _header.scss /* файл стилей для хедера*/
- _content.scss /* файл стилей для блока*/
...
- _footer.scss /* файл стилей с футера */
$base-font-size: 16;
, I store such variables in main.scss , and when they are mentioned in included files, for example in _header.scss - I will get an error, they say _header.scss - does not know what $base is -font-size . @import "_project-variables.scss";
in each included style? Somehow it doesn’t work .. Maybe you can tell me a more optimal method?
Answer the question
In order to leave comments, you need to log in
Move such variables to a separate file and do Dmitrijs Balcers "_project-variables.scss"; in each plug-in style?That's exactly what I'm doing. You can, for example, make mixins that use these variables and connect them, thus hiding the connection of the variables itself, but these are the same eggs, only on the side.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question