Skip to content

Commit 5f9bd8f

Browse files
committed
fix
wip wip
1 parent 8f631d0 commit 5f9bd8f

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

packages/tailwindcss/src/utilities.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20366,6 +20366,9 @@ test('filter', async () => {
2036620366
--drop-shadow: 0 1px 1px rgb(0 0 0 / 0.05);
2036720367
--drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
2036820368
}
20369+
@theme inline {
20370+
--drop-shadow-multi: 0 1px 1px rgb(0 0 0 / 0.05), 0 9px 7px rgb(0 0 0 / 0.1);
20371+
}
2036920372
@tailwind utilities;
2037020373
`,
2037120374
[
@@ -20392,6 +20395,7 @@ test('filter', async () => {
2039220395
'drop-shadow',
2039320396
'drop-shadow/25',
2039420397
'drop-shadow-xl',
20398+
'drop-shadow-multi',
2039520399
'drop-shadow-[0_0_red]',
2039620400
'drop-shadow-red-500',
2039720401
'drop-shadow-red-500/50',
@@ -20486,6 +20490,12 @@ test('filter', async () => {
2048620490
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, );
2048720491
}
2048820492

20493+
.drop-shadow-multi {
20494+
--tw-drop-shadow-size: drop-shadow(0 1px 1px var(--tw-drop-shadow-color, #0000000d)) drop-shadow(0 9px 7px var(--tw-drop-shadow-color, #0000001a));
20495+
--tw-drop-shadow: drop-shadow(0 1px 1px #0000000d) drop-shadow(0 9px 7px #0000001a);
20496+
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, );
20497+
}
20498+
2048920499
.drop-shadow-xl {
2049020500
--tw-drop-shadow-size: drop-shadow(0 9px 7px var(--tw-drop-shadow-color, #0000001a));
2049120501
--tw-drop-shadow: drop-shadow(var(--drop-shadow-xl));

packages/tailwindcss/src/utilities.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4298,7 +4298,8 @@ export function createUtilities(theme: Theme) {
42984298

42994299
if (!candidate.value) {
43004300
let value = theme.get(['--drop-shadow'])
4301-
if (value === null) return
4301+
let resolved = theme.resolve(null, ['--drop-shadow'])
4302+
if (value === null || resolved === null) return
43024303

43034304
return [
43044305
filterProperties(),
@@ -4309,7 +4310,12 @@ export function createUtilities(theme: Theme) {
43094310
alpha,
43104311
(color) => `var(--tw-drop-shadow-color, ${color})`,
43114312
),
4312-
decl('--tw-drop-shadow', `drop-shadow(${theme.resolve(null, ['--drop-shadow'])})`),
4313+
decl(
4314+
'--tw-drop-shadow',
4315+
segment(resolved, ',')
4316+
.map((value) => `drop-shadow(${value})`)
4317+
.join(' '),
4318+
),
43134319
decl('filter', cssFilterValue),
43144320
]
43154321
}
@@ -4350,7 +4356,8 @@ export function createUtilities(theme: Theme) {
43504356
// Shadow size
43514357
{
43524358
let value = theme.get([`--drop-shadow-${candidate.value.value}`])
4353-
if (value) {
4359+
let resolved = theme.resolve(candidate.value.value, ['--drop-shadow'])
4360+
if (value && resolved) {
43544361
if (candidate.modifier && !alpha) return
43554362

43564363
if (alpha) {
@@ -4379,7 +4386,9 @@ export function createUtilities(theme: Theme) {
43794386
),
43804387
decl(
43814388
'--tw-drop-shadow',
4382-
`drop-shadow(${theme.resolve(candidate.value.value, ['--drop-shadow'])})`,
4389+
segment(resolved, ',')
4390+
.map((value) => `drop-shadow(${value})`)
4391+
.join(' '),
43834392
),
43844393
decl('filter', cssFilterValue),
43854394
]

0 commit comments

Comments
 (0)