-
I'm wondering: How do you conceptually deal with creating contrast between backgrounds of the same nature like between a card (with default bg-base-100) and your base background (also bg-base-100)? A shadow alone, especially in dark mode, is barely visible and seems insufficient. I tend towards creating a My main question is whether my general thinking is conceptually right. 😊 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
A good practice is to have a consistent darkening among dark and light themes.
See this 👇 good screenshot from an example on Tailwind CSS website and how good it looks when the card is lightened on both light and dark mode. Most UIs don't bother about this detail and they just invert the color which won't look good because on one theme, your card is darker and on the other theme it's suddenly lighter… This practice is included in daisyUI themes. For example, in both dark and light themes, Example with cards: https://play.tailwindcss.com/0E5PhruZnX
For example, you can set daisyUI doesn't have any opinions about box shadows either, so you can use Tailwind CSS shadow utility classes. They are black by default, but you can use other colors (you can use daisyUI colors as well: Of course if the background is really dark, the default black shadow wont' be visible. You can change the box shadow color of course, but I would suggest to keep it black because shadows are supposed to be dark. If it's light shadow on a dark background, it's not shadow. It's a glow. Avid using absolute color values like Use You can also add a new color name to daisyUI if needed. For example Let me know if you have a question. |
Beta Was this translation helpful? Give feedback.
-
Thanks for this in-depth answer, much appreciated. Conceptually it all makes sense to me. So I guess in the example of the cards, and in line with also the tailwind example, I could do something like the following, which then would also align with the dev experience daisyUI wants to create, right? Either calling it
|
Beta Was this translation helpful? Give feedback.
A good practice is to have a consistent darkening among dark and light themes.
white
card on alight gray
background, dark theme should showdark gray
card onblack
.light gray
card on awhite
background, dark theme should showblack
card ondark gray
.See this 👇 good screenshot from an example on Tailwind CSS website and how good it looks when the card is lightened on both light and dark mode. Most UIs don't bother about this detail and they just invert the color which won't look good because on one theme, your card is darker and on the other theme it's suddenly lighter…
This practice is included in daisyUI themes. For example, in both d…