tailwindcss/packages
Adam Wathan eb3bb4422a
Add shadow-initial and inset-shadow-initial utilities (#14468)
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 <4323180+adamwathan@users.noreply.github.com>
2024-09-20 10:36:22 -04:00
..
@tailwindcss-cli Release v4.0.0-alpha.24 (#14395) 2024-09-12 16:10:56 +02:00
@tailwindcss-node Release v4.0.0-alpha.24 (#14395) 2024-09-12 16:10:56 +02:00
@tailwindcss-postcss Don't override explicit leading-*, tracking-*, or font-{weight} utilities with font-size utility defaults (#14403) 2024-09-18 09:20:04 -04:00
@tailwindcss-standalone Release v4.0.0-alpha.24 (#14395) 2024-09-12 16:10:56 +02:00
@tailwindcss-upgrade Add CSS codemods for migrating @tailwind directives (#14411) 2024-09-18 22:40:23 +02:00
@tailwindcss-vite Release v4.0.0-alpha.24 (#14395) 2024-09-12 16:10:56 +02:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
internal-postcss-fix-relative-paths Support loading config files via @config (#14239) 2024-09-02 18:03:16 +02:00
tailwindcss Add shadow-initial and inset-shadow-initial utilities (#14468) 2024-09-20 10:36:22 -04:00
tsconfig.base.json introduce v4 codebase 2024-03-05 14:29:15 +01:00