From fdf39289c35edc46805ff270964c720cf48c26e6 Mon Sep 17 00:00:00 2001 From: kentonquatman Date: Thu, 9 Jul 2026 04:53:49 +0000 Subject: [PATCH] fix(TabList): light underline on tab hover instead of ghost pill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hovering an unselected Tab or TabMenu trigger now reveals a light bottom-bar underline — a muted version of the selected-tab indicator — rather than the filled ghost-button pill background. Reverts the hover treatment introduced in #1357 while keeping the primary selected colors and layout fill added there. Fixes #2768 --- .changeset/tab-hover-underline.md | 9 ++++ packages/core/src/TabList/Tab.tsx | 42 +++--------------- packages/core/src/TabList/TabList.test.tsx | 8 ++-- packages/core/src/TabList/TabMenu.tsx | 50 ++++++++-------------- 4 files changed, 38 insertions(+), 71 deletions(-) create mode 100644 .changeset/tab-hover-underline.md diff --git a/.changeset/tab-hover-underline.md b/.changeset/tab-hover-underline.md new file mode 100644 index 000000000000..73afb31896f4 --- /dev/null +++ b/.changeset/tab-hover-underline.md @@ -0,0 +1,9 @@ +--- +'@astryxdesign/core': patch +--- + +[fix] Restore the light underline on Tab and TabMenu hover (#2768) + +Hovering an unselected tab now reveals a light bottom-bar underline — a muted version of the selected-tab indicator — instead of the filled ghost-button pill introduced in #1357. + +@kentonquatman diff --git a/packages/core/src/TabList/Tab.tsx b/packages/core/src/TabList/Tab.tsx index dcf4f118c85d..56e621dc9027 100644 --- a/packages/core/src/TabList/Tab.tsx +++ b/packages/core/src/TabList/Tab.tsx @@ -115,23 +115,6 @@ const styles = stylex.create({ ':focus-visible': '2px', }, }, - hoverBg: { - position: 'absolute', - inset: 0, - margin: 'auto', - width: '100%', - borderRadius: radiusVars['--radius-element'], - pointerEvents: 'none', - backgroundColor: { - default: 'transparent', - [stylex.when.ancestor(':hover', tabScope)]: { - '@media (hover: hover)': colorVars['--color-overlay-hover'], - }, - }, - transitionProperty: 'background-color', - transitionDuration: durationVars['--duration-fast'], - transitionTimingFunction: easeVars['--ease-standard'], - }, selected: { color: colorVars['--color-text-primary'], fontWeight: fontWeightVars['--font-weight-semibold'], @@ -153,8 +136,13 @@ const styles = stylex.create({ opacity: 1, }, indicatorUnselected: { - backgroundColor: 'transparent', - opacity: 0, + backgroundColor: colorVars['--color-accent'], + opacity: { + default: 0, + [stylex.when.ancestor(':hover', tabScope)]: { + '@media (hover: hover)': 0.4, + }, + }, }, icon: { display: 'inline-flex', @@ -189,13 +177,6 @@ const sizeStyles = stylex.create({ lg: {height: sizeVars['--size-element-lg']}, }); -// Hover bg uses the standard element size (one step smaller than tab) -const hoverSizeStyles = stylex.create({ - sm: {height: sizeVars['--size-element-sm']}, - md: {height: sizeVars['--size-element-md']}, - lg: {height: sizeVars['--size-element-lg']}, -}); - const layoutStyles = stylex.create({ fill: { flex: 1, @@ -283,13 +264,6 @@ export function Tab({ ), }; - const hoverBgElement = ( -