Skip to content

Is it possible to access the theme colors from Javascript? #415

Answered by saadeghi
wuarmin asked this question in Q&A
Discussion options

You must be logged in to vote

You can import daisyui/src/theming/themes file and get the color values of a theme.
Or you can get the CSS variable value of the current theme.

Example: https://svelte.dev/repl/dcb3fbf9915741fea2f6fce0a0f166ea?version=3.46.2

Edit :
daisyui/src/colors/themes path is now changed to daisyui/src/theming/themes in daisyUI version 3.0

Replies: 5 comments 23 replies

Comment options

You must be logged in to vote
11 replies
@robawolf
Comment options

@saadeghi
Comment options

@robawolf
Comment options

@GodTamIt
Comment options

@robawolf
Comment options

Answer selected by wuarmin
Comment options

You must be logged in to vote
2 replies
@AshSimmonds
Comment options

@saadeghi
Comment options

Comment options

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

Comment options

You must be logged in to vote
8 replies
@saadeghi
Comment options

@Goldziher
Comment options

@MarcGodard
Comment options

@saadeghi
Comment options

@MarcGodard
Comment options

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