Answer the question
In order to leave comments, you need to log in
How to use Sass variables in React?
Hello) How to use Sass variables in React? There is a file color.sass , there are color variables that are needed on all pages. It turns out that I need to import this file in each component.sass file? Or is it possible to import it somewhere where it will be available for all component.sass files ?
Answer the question
In order to leave comments, you need to log in
Not with your approach. Either store the variables in a js file and import them through a template literal
Or collect the sass separately and simply import it in the index `${...}`
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question