How to use the Stylus theme variables from inside components
-
Is it a bad practice to require the stylus vars file to be able to use the colors from inside a component?
-
Certainly not. Import stylus vars files care-free
-
How would one do that anyway?
-
import 'quasar/src/themes/quasar.core.variables.styl'
-
Or you could do
@import '~src/themes/app.variables.styl'
which goes up to the root and searches down. This way if you change your file`s position later on, you wont have to worry compared to when using “…/…/…/” syntax.