Replies: 6 comments
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as low quality.
This comment was marked as low quality.
-
|
You're reading this correctly — The exact current definition of
|
| What you want to transition | Use |
|---|---|
| Shadow size/color/style | transition-shadow |
| Text/background/border colors | transition-colors |
| Both colors and shadows | transition (the base utility, which includes both) |
| Everything | transition-all |
The base transition utility includes box-shadow alongside colors, opacity, transforms, and filters — so if you want both shadow and color transitions together, transition is the right choice rather than combining transition-colors and transition-shadow.
Practical example
<!-- Transitioning shadow only -->
<button class="shadow-sm hover:shadow-lg transition-shadow duration-300">
Hover me
</button>
<!-- Transitioning both color and shadow -->
<button class="bg-blue-500 shadow-sm hover:bg-indigo-500 hover:shadow-lg transition duration-300">
Hover me
</button>So there is no gap here — shadows are fully transitionable, just via transition-shadow or the base transition, not transition-colors. The separation keeps each utility semantically accurate to what it names.
Hope this helps — if it answers your question, would you mind clicking "Mark as answer" so others searching for the same thing can find it quickly?
Beta Was this translation helpful? Give feedback.
-
|
Yes, this is intentional. The Why shadows are excluded:
How to transition shadows: Use <!-- Transition only shadow -->
<div class="transition-shadow shadow-lg hover:shadow-xl">
<!-- Transition everything -->
<div class="transition-all shadow-lg hover:shadow-xl">
<!-- Transition specific properties -->
<div class="transition-[box-shadow] shadow-lg hover:shadow-xl">Custom transition with shadows: /* Custom transition that includes shadow */
.my-element {
transition-property: color, background-color, border-color, box-shadow;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}Or in Tailwind: <div class="transition-[color,background-color,border-color,box-shadow]">Performance tip: If you need smooth shadow transitions, consider using |
Beta Was this translation helpful? Give feedback.
-
|
mate if i wanted to talk to chatgpt i would not come here |
Beta Was this translation helpful? Give feedback.
-
|
This is intentional — box-shadow is not a color-only property. It's a shorthand for
If you need the shadow color to animate alongside other color properties, use <div class="transition-[color,background-color,box-shadow] ..."> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, if I'm reading about
transition-colorshere:https://tailwindcss.com/docs/transition-property
It seems that
shadow-*andinset-shadow-*are not included in thistransition-colorsproperty. Is there a reason for this?Beta Was this translation helpful? Give feedback.
All reactions