Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix inherit color for other shadow utilities
  • Loading branch information
wongjn committed Apr 11, 2025
commit 8ec34463b179ad0b8b29337330209dd0fb56b5ce
12 changes: 0 additions & 12 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23568,12 +23568,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 @@ -24441,12 +24435,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
14 changes: 14 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5127,6 +5127,13 @@ 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 @@ -5404,6 +5411,13 @@ 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