-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add support for “intensity” modifiers on box and text shadows #17398
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
Conversation
594e7f9
to
a7b00c5
Compare
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.
Left a few comments, I also wonder/wish we could only enable features like this if you use them 🤔
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.
Nice, I like it.
@adamwathan you cool with the name |
d542f87
to
95187e8
Compare
We don’t need to use the variable in these cases because the intensity is available directly to the utility when generated. This also helps gurantee that the relative color syntax will only be present in development and when Lighting CSS is unable to inline it
95187e8
to
393c812
Compare
…and `text-shadow-inherit` (#17647) Fixes #17643. This PR completely removes the `color-mix()` function for `shadow-inherit`. This does mean intensity and alpha channel support has been removed when using `shadow-inherit`[^1]. With intensity modifiers in #17398, all colors are wrapped in `color-mix()`. However, it seems `inherit` does not work as a value in `color-mix()` in Firefox or Chrome (don't have a means to test Safari). [^1]: While writing this, I noticed other color utilities allow alpha channel modifier syntax for `inherit` - do we want to look at removing those too? --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com>
This PR adds support for utilities like:
text-shadow-lg/25
It uses relative color syntax to replace the alpha value of the shadow from your theme.
When combined with a colors:
text-shadow-lg/25 text-shadow-red-500
text-shadow-lg/25 text-shadow-red-500/75
The alpha values are multiplied resulting in a shadow with the color specified in
--color-red-500
and alpha values of 25% and 18.75% respectively.