-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(Avatar): create component, theme, and stories #9868
feat(Avatar): create component, theme, and stories #9868
Conversation
✅ ethereum-org-website-dev deploy preview ready
|
@TylerAPfledderer and @pettinarip Made a few changes to the DS Figma file and commented on the changes there Let me know if you need more details? |
[$border.variable]: "transparent", | ||
borderWidth: "1px", | ||
"&:hover, [data-peer]:hover ~ &": { | ||
boxShadow: "buttonHover", |
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.
Can't remember where we ended up with this but talking async with @nloureiro, we said that it would be nice if we can use a more dynamic shadow size for the Avatar.
// we tested with 0.15em and its fine
boxShadow="0.15em 0.15em 0 color"
but I think this will only apply for the Avatar, the other components should keep using the primary
shadow.
Let me know what do you think on this implementation @TylerAPfledderer
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.
@pettinarip I've pushed this change for you to view.
Though it looks very minor. I'm seeing clipping which does not occur if pixel values are applied.
Not sure what is causing this on my end.
[$mlBySize.variable]: "space.-1", | ||
}, | ||
excessLabel: { | ||
fontSize: "0.563rem", |
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.
Curious about this value. How did you get it?
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.
In the DS for the xs
size avatar, the excess label is showing a font size of 9px
which is this in rem.
This value is not a part of the default fontSize tokens. 2xs
in the default theme is 0.625rem
, and 3xs
is 0.45rem
.
_light: "4px 4px 0 var(--eth-colors-blue-100)", | ||
_dark: "4px 4px 0 #352313", | ||
}, | ||
}, |
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, is the idea to delete the shadows
file at some point? or should we still keep using that file to separate a bit the tokens.
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.
@pettinarip this is here because a semantic color is not being declared in the DS for this style of shadow, so a semantic has to be made for each color based on color mode.
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.
We need to use primary.lowContrast
here but our orange.800
is outdated.
We need to update orange.800
to #352313
and then we can use primary.lowContrast
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.
With the latest updates from the base branch, this has taken care of itself. Still have to push a commit to remove buttonHover
from semanticTokens
.
What do you exactly mean with the spacing? the current spacing in the code is 0.25rem = 4px. On the other side, we are going to implement a dynamic shadow using |
I think we need to bump the spacing to 8px, between the avatar and the username |
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.
Ok, in summary, I think what is left in this PR is:
- dynamic shadow using
em
- fix shadow color using
primary.lowContrast
and updating theorange.800
color - fix the spacing from 4px to 8px
All items have been addressed. As to the spacing between avatar and link text, the DS shows padding around the text container, which contributes to the larger gap. So there is a 4px gap between the avatar and text container, plus 4px padding in the text container. |
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've a question about the font sizes used in the avatar text but not a blocker. Good job!
Co-authored-by: Pablo Pettinari <pettinarip@gmail.com>
Description
This PR creates the Avatar component per the new DS
LinkBox
/LinkOverlay
component pair)Related Issue
This is a part of the implementation of the DS v1 #9548