Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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

### Fixed

- Fix `drop-shadow-*` when multiple shadows are used in the theme ([#15056](https://github.com/tailwindlabs/tailwindcss/pull/15056))
- _Upgrade (experimental)_: Ensure migrating to the `in-*` requires a descendant selector ([#15054](https://github.com/tailwindlabs/tailwindcss/pull/15054))

## [4.0.0-alpha.35] - 2024-11-20
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13698,7 +13698,7 @@ test('filter', async () => {
}

.drop-shadow-xl {
--tw-drop-shadow: drop-shadow(var(--drop-shadow-xl));
--tw-drop-shadow: drop-shadow(0 20px 13px #00000008) drop-shadow(0 8px 5px #00000014);
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, );
}

Expand Down
17 changes: 13 additions & 4 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export function createUtilities(theme: Theme) {
supportsNegative?: boolean
supportsFractions?: boolean
themeKeys?: ThemeKey[]
inlineThemeValues?: boolean
defaultValue?: string | null
handleBareValue?: (value: NamedUtilityValue) => string | null
handleNegativeBareValue?: (value: NamedUtilityValue) => string | null
Expand Down Expand Up @@ -280,10 +281,17 @@ export function createUtilities(theme: Theme) {
if (candidate.modifier) return
value = candidate.value.value
} else {
value = theme.resolve(
candidate.value.fraction ?? candidate.value.value,
desc.themeKeys ?? [],
)
if (desc.inlineThemeValues) {
value = theme.resolveValue(
candidate.value.fraction ?? candidate.value.value,
desc.themeKeys ?? [],
)
} else {
value = theme.resolve(
candidate.value.fraction ?? candidate.value.value,
desc.themeKeys ?? [],
)
}

// Automatically handle things like `w-1/2` without requiring `1/2` to
// exist as a theme value.
Expand Down Expand Up @@ -3473,6 +3481,7 @@ export function createUtilities(theme: Theme) {
])
functionalUtility('drop-shadow', {
themeKeys: ['--drop-shadow'],
inlineThemeValues: true,
handle: (value) => [
filterProperties(),
decl(
Expand Down