Skip to content

Add drop-shadow-* color support #17434

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

Merged
merged 6 commits into from
Apr 1, 2025
Merged

Add drop-shadow-* color support #17434

merged 6 commits into from
Apr 1, 2025

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Mar 28, 2025

This PR adds support for two things:

  • New drop-shadow-{color} utilities which can be used to control the filder drop shadow color
  • New drop-shadow-*/{alpha} utilities which can be used to control the intensity of the drop shadow

Note that drop-shadow-* utilities without a modifier use variables from your theme.

If you opt into using drop shadow colors or drop-shadow "intensity" utilities we will inline these values into your CSS when using a drop shadow color or drop shadow intensity utility and as such can't be changed by changing the theme variables on a per-element/tree basis.

@thecrypticace thecrypticace force-pushed the feat/drop-shadow-colors branch from 20476ae to b9f294e Compare March 28, 2025 17:48
@thecrypticace thecrypticace force-pushed the feat/drop-shadow-colors branch from b9f294e to a4872d9 Compare March 28, 2025 18:36
@thecrypticace thecrypticace force-pushed the feat/drop-shadow-colors branch from a4872d9 to 8cb6505 Compare March 28, 2025 18:40
@thecrypticace thecrypticace marked this pull request as ready for review March 28, 2025 18:59
@thecrypticace thecrypticace requested a review from a team as a code owner March 28, 2025 18:59
@thecrypticace
Copy link
Contributor Author

@adamwathan Would be good to get your eyes on the implementation to see if there's anything you'd prefer to change about this. They work mostly the same as the existing text-shadow, inset-shadow, and shadow utilities.

Comment on lines 4388 to 4392
`drop-shadow(${replaceShadowColors(
v,
alpha,
(color) => `var(--tw-drop-shadow-color, ${color})`,
)})`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the API changed here because this is passing 3 values instead of 2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I think it's because I pressed the update button (because of conflicts in the CHANGELOG.md file)

@thecrypticace thecrypticace enabled auto-merge (squash) April 1, 2025 15:01
Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Art.

image image

@thecrypticace thecrypticace merged commit 9374647 into main Apr 1, 2025
7 checks passed
@thecrypticace thecrypticace deleted the feat/drop-shadow-colors branch April 1, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants