Hi everyone! Seems like the Compose team is worki...
# compose
s
Hi everyone! Seems like the Compose team is working on adding customizable drop/inner shadows to Compose natively: https://android-review.googlesource.com/c/platform/frameworks/support/+/2594888 This is super exciting news! I also think it's the best time to fix a "layering" issue in Compose with the existing shadows. Currently, elevation-based shadows are living in the Compose Foundation layer, which is kind of a mistake IMHO. Elevation is very specific to Material, thus should be moved to the Compose Material layers. I'm not aware of any other design system that really wants this particular implementation of shadows (elevation-based), and even M3 is pulling away from shadows altogether. Now that the more generic, proper shadow is here, this probably the best time to make this move. It may take a couple release cycles to do this, and a deprecation that developers will have to deal with (though that should be generally painless with
replaceWith
), but it's very much worth it IMHO. One other thing is to rename it to
elevation
, but that probably not worth it, as `boxShadow`/`dropShadow` are more descriptive, and it's more like
BasicText
and
BasicTextField
, so design systems built on top of foundation can use the nicer
Text
and
TextField
names. Would love to hear your thoughts!
1
r
Setting aside the problem of breaking APIs, etc. the current shadow modifier relies on existing public APIs that wouldn’t make sense to also deprecate/remove (and these APIs can’t be moved to Material).
(and to nitpick: elevation shadows are more “proper” shadows technically than box shadows 🙂)
s
Aha, thanks for the clarification!
(reply to nitpick: elevation shadows are indeed more accurate physically-speaking, but they're not what we usually think of in terms of UI. the standard is customizable shadows. i've also found elevation shadows quite impractical to get right on larger screens due to the singular source of light, where a card on the right of the screen gets a shadow tilted to the right, and stuff at the very bottom gets a very long shadow. so yeah, it fits material design which deals with "materials" in a 3d space, but practically leads to unpleasant UIs in some cases)
👍 2