Skip to content

Commit 4f63a5a

Browse files
Inline theme values in drop-shadow (#15056)
This PR updates the default `drop-shadow-*` values to use a single shadow instead of multiple shadows. This ensures that the usage with `drop-shadow(var(--drop-shadow-xl))` is correct because the `drop-shadow(…)` needs to encode a single drop shadow. --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent fcf948f commit 4f63a5a

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
- _Upgrade (experimental)_: Ensure migrating to the `in-*` requires a descendant selector ([#15054](https://github.com/tailwindlabs/tailwindcss/pull/15054))
1919

20+
### Changed
21+
22+
- Use single drop shadow values instead of multiple ([#15056](https://github.com/tailwindlabs/tailwindcss/pull/15056))
23+
2024
## [4.0.0-alpha.35] - 2024-11-20
2125

2226
### Added

packages/@tailwindcss-postcss/src/__snapshots__/index.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,10 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
335335
--inset-shadow-xs: inset 0 1px 1px #0000000d;
336336
--inset-shadow-sm: inset 0 2px 4px #0000000d;
337337
--drop-shadow-xs: 0 1px 1px #0000000d;
338-
--drop-shadow-sm: 0 1px 2px #0000001a, 0 1px 1px #0000000f;
339-
--drop-shadow-md: 0 4px 3px #00000012, 0 2px 2px #0000000f;
340-
--drop-shadow-lg: 0 10px 8px #0000000a, 0 4px 3px #0000001a;
341-
--drop-shadow-xl: 0 20px 13px #00000008, 0 8px 5px #00000014;
338+
--drop-shadow-sm: 0 1px 2px #00000026;
339+
--drop-shadow-md: 0 3px 3px #0000001f;
340+
--drop-shadow-lg: 0 4px 4px #00000026;
341+
--drop-shadow-xl: 0 9px 7px #0000001a;
342342
--drop-shadow-2xl: 0 25px 25px #00000026;
343343
--ease-in: cubic-bezier(.4, 0, 1, 1);
344344
--ease-out: cubic-bezier(0, 0, .2, 1);

packages/tailwindcss/src/__snapshots__/index.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ exports[`compiling CSS > \`@tailwind utilities\` is replaced by utilities using
334334
--inset-shadow-xs: inset 0 1px 1px #0000000d;
335335
--inset-shadow-sm: inset 0 2px 4px #0000000d;
336336
--drop-shadow-xs: 0 1px 1px #0000000d;
337-
--drop-shadow-sm: 0 1px 2px #0000001a, 0 1px 1px #0000000f;
338-
--drop-shadow-md: 0 4px 3px #00000012, 0 2px 2px #0000000f;
339-
--drop-shadow-lg: 0 10px 8px #0000000a, 0 4px 3px #0000001a;
340-
--drop-shadow-xl: 0 20px 13px #00000008, 0 8px 5px #00000014;
337+
--drop-shadow-sm: 0 1px 2px #00000026;
338+
--drop-shadow-md: 0 3px 3px #0000001f;
339+
--drop-shadow-lg: 0 4px 4px #00000026;
340+
--drop-shadow-xl: 0 9px 7px #0000001a;
341341
--drop-shadow-2xl: 0 25px 25px #00000026;
342342
--ease-in: cubic-bezier(.4, 0, 1, 1);
343343
--ease-out: cubic-bezier(0, 0, .2, 1);

packages/tailwindcss/src/utilities.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13613,8 +13613,8 @@ test('filter', async () => {
1361313613
css`
1361413614
@theme {
1361513615
--blur-xl: 24px;
13616-
--drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
13617-
--drop-shadow-xl: 0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08);
13616+
--drop-shadow: 0 1px 1px rgb(0 0 0 / 0.05);
13617+
--drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
1361813618
}
1361913619
@tailwind utilities;
1362013620
`,
@@ -13639,6 +13639,7 @@ test('filter', async () => {
1363913639
'invert',
1364013640
'invert-0',
1364113641
'invert-[var(--value)]',
13642+
'drop-shadow',
1364213643
'drop-shadow-xl',
1364313644
'drop-shadow-[0_0_red]',
1364413645
'saturate-0',
@@ -13653,8 +13654,8 @@ test('filter', async () => {
1365313654
).toMatchInlineSnapshot(`
1365413655
":root {
1365513656
--blur-xl: 24px;
13656-
--drop-shadow: 0 1px 2px #0000001a, 0 1px 1px #0000000f;
13657-
--drop-shadow-xl: 0 20px 13px #00000008, 0 8px 5px #00000014;
13657+
--drop-shadow: 0 1px 1px #0000000d;
13658+
--drop-shadow-xl: 0 9px 7px #0000001a;
1365813659
}
1365913660
1366013661
.blur-\\[4px\\] {
@@ -13692,6 +13693,11 @@ test('filter', async () => {
1369213693
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, );
1369313694
}
1369413695
13696+
.drop-shadow {
13697+
--tw-drop-shadow: drop-shadow(var(--drop-shadow));
13698+
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, );
13699+
}
13700+
1369513701
.drop-shadow-\\[0_0_red\\] {
1369613702
--tw-drop-shadow: drop-shadow(0 0 red);
1369713703
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, );

packages/tailwindcss/theme.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@
367367
--inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / 0.05);
368368

369369
--drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);
370-
--drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);
371-
--drop-shadow-md: 0 4px 3px rgb(0 0 0 / 0.07), 0 2px 2px rgb(0 0 0 / 0.06);
372-
--drop-shadow-lg: 0 10px 8px rgb(0 0 0 / 0.04), 0 4px 3px rgb(0 0 0 / 0.1);
373-
--drop-shadow-xl: 0 20px 13px rgb(0 0 0 / 0.03), 0 8px 5px rgb(0 0 0 / 0.08);
370+
--drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);
371+
--drop-shadow-md: 0 3px 3px rgb(0 0 0 / 0.12);
372+
--drop-shadow-lg: 0 4px 4px rgb(0 0 0 / 0.15);
373+
--drop-shadow-xl: 0 9px 7px rgb(0 0 0 / 0.1);
374374
--drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);
375375

376376
--ease-in: cubic-bezier(0.4, 0, 1, 1);

0 commit comments

Comments
 (0)