chore: Update icon sizes with new design intent - #10414
Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
| | 96 | ||
| | 112 | ||
| | (number & {}) | ||
| | `${number}lh`; |
There was a problem hiding this comment.
do we want this API? are users likely to do anything other than 1lh? should we limit it?
There was a problem hiding this comment.
based on what was discussed in otters, I think this is fine, did you also want to include rlh as well or should that be removed from the style macro for now since you aren't using it elsewhere?
There was a problem hiding this comment.
it's a valid unit for other places and is widely supported, so think it should be added regardless
There was a problem hiding this comment.
then should this have ${number}rlhtoo then?
There was a problem hiding this comment.
no, the intent for Avatar is just to match the workflow icon sizing, which is 1lh
we can eventually add all the other units. From discussion:
and we could eventually allow any css unit for size
|
Build successful! 🎉 |
|
Build successful! 🎉 |
## API Changes
@react-spectrum/s2/@react-spectrum/s2:Avatar Avatar {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
alt?: string
id?: string
isOverBackground?: boolean
size?: number | number | number | number | number | number | number | number | number | number | number | number | number | number | (number & {
-}) = 24
+}) | `${number}lh` = 24
slot?: string | null
src?: string
styles?: StylesPropWithoutWidth
}/@react-spectrum/s2:AvatarProps AvatarProps {
UNSAFE_className?: UnsafeClassName
UNSAFE_style?: CSSProperties
alt?: string
id?: string
isOverBackground?: boolean
size?: number | number | number | number | number | number | number | number | number | number | number | number | number | number | (number & {
-}) = 24
+}) | `${number}lh` = 24
slot?: string | null
src?: string
styles?: StylesPropWithoutWidth
} |
Agent Skills ChangesModified (9)
InstallReact Spectrum S2: React Aria: |
Closes
Updates from design. Testing for chromatic and checking breadth of changes. The intent of design was to have the icon match the line height of the text. This works perfectly with the widely available
lhunit. I had to make a few small changes to Avatar to also support it, but overall it simplifies our code.https://www.chromatic.com/build?appId=5f0dd5ad2b5fc10022a2e320&number=1285
The question we'll need to answer, is this breaking, from a design point of view. It's not breaking any APIs since I'm not changing how fontRelative works. I did add to our existing API for Avatar, but that should be non-breaking. The question about breaking is, does anyone use
fontRelative(20)already and will it be noticeable next to our components.✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: