Add color
-
how to add color in the quasar at run time?
-
Color to what or of what?
Scott
-
As there is primary, secondary, I would like to create mine like cor1, cor2, cor3. I know I can put them in the sass file, but I would like to create them dynamically
-
Explained here : https://quasar.dev/quasar-utils/color-utils#Create-Dynamic-Custom-Colors
Create some classes in CSS (or SASS) with a default value :
$col1 = #123456 :root --q-color-col1 $col1 .text-col1 color: $col1 !important color: var(--q-color-col1) !important .bg-col1 background: $col1 !important background: var(--q-color-col1) !important
Then, you can use
setBrand
helperimport { colors } from 'quasar' const { setBrand } = colors setBrand ('col1', '#FF0000')