-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update default drop-shadow-*
values to use a single shadow
#15056
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to do the same in here:
Otherwise this won't work. Let's add drop-shadow
to the list of tests.
diff --git a/packages/tailwindcss/src/utilities.test.ts b/packages/tailwindcss/src/utilities.test.ts
index b16c6f125..e6120023c 100644
--- a/packages/tailwindcss/src/utilities.test.ts
+++ b/packages/tailwindcss/src/utilities.test.ts
@@ -13639,6 +13639,7 @@ test('filter', async () => {
'invert',
'invert-0',
'invert-[var(--value)]',
+ 'drop-shadow',
'drop-shadow-xl',
'drop-shadow-[0_0_red]',
'saturate-0',
@@ -13692,6 +13693,11 @@ 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 {
+ --tw-drop-shadow: drop-shadow(var(--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-\\[0_0_red\\] {
--tw-drop-shadow: drop-shadow(0 0 red);
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, );
Can't add a suggestion/comment on untouched lines so had to do it this way 😅 |
We updated the drop shadow values to have a single shadow instead of multiple values which allows us to keep using the `var(…)` instead of inlining it. The caveat is that if you define a custom drop shadow that contains multiple values then that won't be valid CSS because the two (or more) drop shadows will be wrapped in a `drop-shadow(shadow-1, shadow-2, …)`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good but need to update the PR description 🙈
drop-shadow
drop-shadow-*
values to use a single shadow
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 thedrop-shadow(…)
needs to encode a single drop shadow.