S
S
sorry_i_noob2019-08-22 21:42:57
JavaScript
sorry_i_noob, 2019-08-22 21:42:57

Is there any way to get variables from a JS file using SASS? Or vice versa - using JS - from a SASS file?

Hello.
Each layout has its own variables for breakpoints, for example. Or just for the size of any element.
What I want to do is to write these variables just once instead of twice - one for JS, one for SASS.
How can I do it? How to read a file using SASS .js? Or how to read a SASS file using JS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2019-08-22
@SkiperX

https://medium.com/@codepo8/using-css-custom-attri...
translation
https://css-live.ru/articles/polzovatelskie-css-at...

G
grinat, 2019-08-22
@grinat

Styled components and analogues. Or import json files through webpack loaders.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question