Skip to content

Changing colors on runtime? #777

Answered by saadeghi
NathanTe asked this question in Q&A
May 5, 2022 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Each color is a CSS variable with HSL values.
You can see the colors of all built-in themes here: https://unpkg.com/browse/daisyui@2.14.3/dist/themes.css
And here you can see the list of all color names and their variable name.

And you can change the color on runtime by changing the value of CSS variable.
If your color has a different format like hex, RGB, etc... you need a JS function (or a node package) to convert the format and extract the HSL values.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@NathanTe
Comment options

@saadeghi
Comment options

@NathanTe
Comment options

Answer selected by saadeghi
Comment options

You must be logged in to vote
1 reply
@saadeghi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants