Skip to content

How to use themes with CDN #3133

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

You must be logged in to vote

@aalaap These are the CSS variables:
https://unpkg.com/browse/daisyui@4.12.10/dist/themes.css

For example --p: 49.12% 0.3096 275.75; is primary color (docs) and the value 49.12% 0.3096 275.75 is OKLCH lightness chroma hue.

You can play with them or convert them in this website: https://oklch.com/

To add a new custom theme using CDN (if you don't have a Tailwind node setup to generate the CSS file) you can add a CSS file to your project with this:

[data-theme=mytheme] {
    color-scheme: light;
    --in: 72.06% 0.191 231.6;
    --su: 64.8% 0.150 160;
    --wa: 84.71% 0.199 83.87;
    --er: 71.76% 0.221 22.18;
    --pc: 89.824% 0.06192 275.75;
    --ac: 15.352% 0.0368 183.61;
    --inc: 0% 0 0

Replies: 1 comment 3 replies

Comment options

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

@saadeghi
Comment options

Answer selected by henriqueleite42
@aalaap
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