-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR complements #14458 by adding new `shadow-initial` and `inset-shadow-initial` utilities that make it possible to "undo" a custom shadow color and revert to the default shadow color for the current shadow size. For example, in this example the shadow will be red on hover even though the default color for the `shadow` utility is `rgb(0 0 0 / 5%)`: ```html <div class="shadow-sm shadow-red-500 hover:shadow"> <!-- … --> </div> ``` This is usually what you want, but if you actually want `hover:shadow` to apply its default color, you need to know what the color is and add it yourself: ```html <div class="shadow-sm shadow-red-500 hover:shadow hover:shadow-black/5"> <!-- … --> </div> ``` Using `shadow-initial`, you can achieve the same thing without having to know what the original color was: ```html <div class="shadow-sm shadow-red-500 hover:shadow hover:shadow-initial"> <!-- … --> </div> ``` The `inset-shadow-initial` utility does the same thing for the `inset-shadow-*` utilities. --------- Co-authored-by: Adam Wathan <[email protected]>
- Loading branch information
1 parent
bf115bf
commit eb3bb44
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters