fix(core): give underlined Link a visible hover state#3182
Conversation
|
Someone is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for working on this. @kentonquatman when you filed #2852 did you have a specific visual in mind for when a link with hasUnderline is hovered? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks for this contribution! For this update, we'd like to keep the underline and just have a color change on hover - similar to Material Design, IBM Carbon, and Microsoft Fluent. The trick will be figuring out how to make it work across all themes. |
|
Maybe we just need to add theme support for hover: https://github.com/facebook/astryx/blob/main/packages/core/src/Link/Link.tsx#L107-L126 |
We want to try to avoid having component or situation specific tokens in gimbals since it can lead to expansion and these need to be kept as minimal as possible to avoid memory crashes on complex apps. I'm thinking we can do a color adjust using --color-tint in the base styling for links with underline. This should work well in most cases then can be adjusted by component override theming for themes that want something different. |
cixzhang
left a comment
There was a problem hiding this comment.
Let's follow the design adjustment to adjust the color on hover using the tint.
Per design review, underlined links get their hover affordance from a color shift using --color-tint-hover (color-mix 15%), matching Slider/Switch/RadioList — not by toggling the underline off.
0c28a86 to
25093f8
Compare
|
Reworked to follow the design direction: instead of toggling the underline off on hover, links now shift their color on hover using the hover tint — This gives always-underlined links ( Note: the old branch had drifted ~73 commits behind main (it predated the |
|
Thanks @durvesh1992! |
Summary
Closes #2852.
When
hasUnderlineis enabled,Linkwas always underlined, so the base:hover → underlinerule produced no visible change on hover. Now the underline flips off on hover — a clear affordance that mirrors the default link (which adds an underline on hover). Both variants now have symmetric, visible hover feedback, using the existingtext-decorationmechanism (no new tokens).packages/core/src/Link/Link.tsx—styles.hasUnderlinegains a:hover(under@media (hover: hover)) that setstext-decoration: none.Testing
pnpm -F @astryxdesign/core test Link— 50/50 pass.astryx.css:@media (hover: hover){…:hover…{text-decoration:none}}.Changeset
Included (
@astryxdesign/corepatch).