Well, you would just store them in variables if you need them in JS. How you handle those variables would be dependant on what you’re doing with them. ie: component level, state, store, config file, etc.
The 2 biggest ways of using CSS in React apps are with CSS Modules (I’m a big fan of these) and Styled Components (not a fan).
I have had a good bit of success using CSS Variables with PostCSS-CSSNext. CSSNext isn’t quite as good as SASS, but it’s pretty damn close and is based on emerging standards instead of 3rd party implementation. This mixes well with CSS Modules.
Thanks mawburn,
I want to create the variables in a js file and use them in a CSS file.
I am just styling the components. How would I import the variables to the CSS file? Can I import the whole file or do i have to import each variable individually?