Q
Q
qfrontend2019-02-18 15:21:14
React
qfrontend, 2019-02-18 15:21:14

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

1 answer(s)
A
Anton Filippov, 2019-02-18
@qfrontend

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 question

Ask a Question

731 491 924 answers to any question