Replies: 9 comments 5 replies
-
First of all, I hope your surgery goes well! Thank you for making daisyUI more awesome. I'm a little confused about custom theme support in old browsers. You say that custom themes are not supported by old browsers, and in the changelog you say "For old browsers, daisyUI provides HEX fallback colors only for the default dark/light themes". Does that mean I can define a custom theme with HEX colors and it will work in old browsers, or no? If I can, how do I define a custom theme that uses OKLCH as well as providing HEX fallbacks? |
Beta Was this translation helpful? Give feedback.
-
Hope you could have a godspeed recovery, thanks a lot for your efforts! |
Beta Was this translation helpful? Give feedback.
-
I wish you a speedy recovery ! Hope everything goes well! |
Beta Was this translation helpful? Give feedback.
-
Thanks Pouya! Hope the surgery and recovery goes well. |
Beta Was this translation helpful? Give feedback.
-
Thank you for making daisyUI more awesome. |
Beta Was this translation helpful? Give feedback.
-
Just wrote a couple of codemods to address the changes and pushed to npm |
Beta Was this translation helpful? Give feedback.
-
Thank you for sharing this and for the v.4 update! I suggest you to include this guide in the website docs, maybe in a page called "migration to 4" or similar, as it would probably be the first place where people go to check the docs. I was almost opening an issue myself with a request for clarification about the migration, before checking the discussions here :) |
Beta Was this translation helpful? Give feedback.
-
I have found a difference between how the gradients are rendered. New one seems more accurate. I am using the light theme with these classes: (Geçmiş olsun) |
Beta Was this translation helpful? Give feedback.
-
Hey @saadeghi, can i migrate the colors during the upgrade as follows: hsl(var(--b2) / 0.2) to oklch(var(--b2) / 0.2) or do I have to use |
Beta Was this translation helpful? Give feedback.
-
daisyUI 4.0 is here 🎉
Thank you for using daisyUI and thanks for reporting issues.
If you're upgrading from daisyUI 3 to daisyUI 4, here you can see all the changes:
https://daisyui.com/docs/changelog/
In this page you can see the things you need to change:
Themes and Colors
The biggest breaking change (as you can see in the changelog) is using OKLCH colors internally instead of HSL.
That means if you're using the value of daisyUI color variables in your project (like
--p
for primary color) the value of those CSS variables are no longerH S L
. They'reL C H
now and you need to use them inoklch()
CSS color function.daisyUI themes are no longer supposed in old browsers (see OKLCH compatibility chart) and old browsers will only show a fallback default theme.
Using
hsl()
functionUsing
oklch()
functionAll
*-focus
colors are removedYou can use a
color-mix()
arbitrary class to have more control on the the colors:For example, here we mix each color with black to create the same colors from daisyUI 3:
Extending themes
There's a change in property names in
daisyui/src/theming/themes.js
file.If you're customizing built-in daisyUI themes, change it:
RTL
All components now support LTR/RTL without any config or plugin.
Just add
dir=rtl
to<html>
tag and everything will be RTL on runtime.Tab
tabs
class is now using grid, instead of flex.:before
) instead of two (:before
andafter
)tab
are removed:tab-lifted
tab-bordered
tab-lg
tab-md
tab-sm
tab-xs
tabs
class instead:tabs-lifted
tabs-bordered
tabs-lg
tabs-md
tabs-sm
tabs-xs
button
buttons are not uppercase by default anymore. You can use
uppercase
if you want to make them uppercase.This guide will be updated if there are any missing details.
Fill free to open issues and open PRs 💚
PS: I'm having a lung surgery today. I will continue to fix issues as soon as I can. Thank you for your patience 🙏
Update: Surgery went well. Thank you all for the warm messages 💚
Beta Was this translation helpful? Give feedback.
All reactions