Skip to content

Not able to change default color for shadow #18264

Answered by wongjn
amir20 asked this question in Help

You must be logged in to vote

This is a bug in what seems to be the browser developer tools. If we look at the relevant @property rule:

@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}

We see that inherits is false. This means the value from :root (compiled from your @theme) does not inherit down. This intended to stop unintentional child shadow color inheritance.

The default shadow color is part of the shadow definitions. So to change the default color, you'd need to replace the default shadow theme tokens: https://play.tailwindcss.com/IuIY2QZYCI?file=css

Alternatively, you can use a shadow-<color> utility class: https://play.tailwindcss.com/WGXMeWIZdQ

Replies: 1 comment 4 replies

You must be logged in to vote
4 replies
@amir20

@wongjn

wongjn Jun 9, 2025
Collaborator

Answer selected by amir20
@amir20

@amir20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #18263 on June 09, 2025 18:46.