Importing styles (js variables) from a design library to my scss files

36 views Asked by At

I am supposed to use a custom design library that exports styles - fonts, font weights etc as js objects. My code base uses scss files. is there any way i can use js objects in my scss files?

i haven't tried more than importing and converting js objects to json files.

1

There are 1 answers

0
shiningfinger On

Good way to have a common theme is to use tailwind https://tailwindcss.com/docs/theme. You can describe your system's theme inside the config. It'll generate atomic classes and then you can use it inside your sass file and also import that config with colors to js files

https://tailwindcss.com/docs/using-with-preprocessors