Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure the `color-mix(…)` polyfill creates fallbacks for theme variables that reference other theme variables ([#17562](https://github.com/tailwindlabs/tailwindcss/pull/17562))
- Fix brace expansion in `@source inline('z-{10..0}')` with range going down ([#17591](https://github.com/tailwindlabs/tailwindcss/pull/17591))
- Ensure container query variant names can contain hyphens ([#17628](https://github.com/tailwindlabs/tailwindcss/pull/17628))
- Ensure `shadow-inherit`, `inset-shadow-inherit`, `drop-shadow-inherit`, and `text-shadow-inherit` inherits the shadow color ([#17647](https://github.com/tailwindlabs/tailwindcss/pull/17647))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah turns out it's 4, you added drop-shadow-inherit to that list but fixed it for inset-shadow-inherit. 🙈 I added a test for drop-shadow-inherit 👍


## [4.1.3] - 2025-04-04

Expand Down
30 changes: 12 additions & 18 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20943,6 +20943,8 @@ test('filter', async () => {
'drop-shadow-[0_0_red]',
'drop-shadow-red-500',
'drop-shadow-red-500/50',
'drop-shadow-none',
'drop-shadow-inherit',
'saturate-0',
'saturate-[1.75]',
'saturate-[var(--value)]',
Expand Down Expand Up @@ -21046,6 +21048,16 @@ test('filter', async () => {
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
}

.drop-shadow-none {
--tw-drop-shadow: ;
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
}

.drop-shadow-inherit {
--tw-drop-shadow-color: inherit;
--tw-drop-shadow: var(--tw-drop-shadow-size);
}

.drop-shadow-red-500 {
--tw-drop-shadow-color: #ef4444;
--tw-drop-shadow: var(--tw-drop-shadow-size);
Expand Down Expand Up @@ -23568,12 +23580,6 @@ test('text-shadow', async () => {
--tw-text-shadow-color: inherit;
}

@supports (color: color-mix(in lab, red, red)) {
.text-shadow-inherit {
--tw-text-shadow-color: color-mix(in oklab, inherit var(--tw-text-shadow-alpha), transparent);
}
}

.text-shadow-none {
text-shadow: none;
}
Expand Down Expand Up @@ -23968,12 +23974,6 @@ test('shadow', async () => {
--tw-shadow-color: inherit;
}

@supports (color: color-mix(in lab, red, red)) {
.shadow-inherit {
--tw-shadow-color: color-mix(in oklab, inherit var(--tw-shadow-alpha), transparent);
}
}

.shadow-red-500 {
--tw-shadow-color: #ef4444;
}
Expand Down Expand Up @@ -24447,12 +24447,6 @@ test('inset-shadow', async () => {
--tw-inset-shadow-color: inherit;
}

@supports (color: color-mix(in lab, red, red)) {
.inset-shadow-inherit {
--tw-inset-shadow-color: color-mix(in oklab, inherit var(--tw-inset-shadow-alpha), transparent);
}
}

.inset-shadow-red-500 {
--tw-inset-shadow-color: #ef4444;
}
Expand Down
20 changes: 20 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4399,6 +4399,14 @@ export function createUtilities(theme: Theme) {
{
let value = resolveThemeColor(candidate, theme, ['--drop-shadow-color', '--color'])
if (value) {
if (value === 'inherit') {
return [
filterProperties(),
decl('--tw-drop-shadow-color', 'inherit'),
decl('--tw-drop-shadow', `var(--tw-drop-shadow-size)`),
]
}

return [
filterProperties(),
decl('--tw-drop-shadow-color', withAlpha(value, 'var(--tw-drop-shadow-alpha)')),
Expand Down Expand Up @@ -5127,6 +5135,10 @@ export function createUtilities(theme: Theme) {
case 'none':
if (candidate.modifier) return
return [textShadowProperties(), decl('text-shadow', 'none')]

case 'inherit':
if (candidate.modifier) return
return [textShadowProperties(), decl('--tw-text-shadow-color', 'inherit')]
}

// Shadow size
Expand Down Expand Up @@ -5275,6 +5287,10 @@ export function createUtilities(theme: Theme) {
decl('--tw-shadow', nullShadow),
decl('box-shadow', cssBoxShadowValue),
]

case 'inherit':
if (candidate.modifier) return
return [boxShadowProperties(), decl('--tw-shadow-color', 'inherit')]
}

// Shadow size
Expand Down Expand Up @@ -5397,6 +5413,10 @@ export function createUtilities(theme: Theme) {
decl('--tw-inset-shadow', nullShadow),
decl('box-shadow', cssBoxShadowValue),
]

case 'inherit':
if (candidate.modifier) return
return [boxShadowProperties(), decl('--tw-inset-shadow-color', 'inherit')]
}

// Shadow size
Expand Down