fix(desktop): tab ✕ fade lands on the visible field under Glass

Under Window Translucency → Glass, the glass block sets the surface
tokens transparent so <body> is the sole painter. A tab's `--tab-face`
read those tokens, so the ✕ runway resolved to transparent→transparent
and the chip's `bg-(--tab-face)` painted nothing: hovering showed a bare
✕ over un-faded text, with no gradient at all.

Add a `data-glass-field` contract beside the block's existing
`data-glass-opaque` / `data-glass-raised`: a declarer receives
`--glass-field`, the same body mix glass already paints. The tab prefers
it and falls back to its own surface token (`--tab-surface`, which
TAB_ACTIVE / TAB_IDLE now set instead of `--tab-bg` so they feed the
chain rather than bypass it). Face, hover-darken, and the selection wash
all inherit the one base. Inert with glass off: the fallback resolves to
the exact opaque surface it did before.
This commit is contained in:
Brooklyn Nicholson
2026-09-04 13:02:01 -05:00
committed by brooklyn!
parent ff75ff2a18
commit 433f719676
2 changed files with 19 additions and 3 deletions
+9 -3
View File
@@ -16,8 +16,13 @@ export const PANE_TAB_STRIP_LINE_RIGHT = 'shadow-[inset_-1px_0_0_var(--ui-stroke
// the label after every wash lands. The hover close-button gradient fades into
// it, so the fade is seamless on any theme. Idle hover repaints it below with
// the same color-mix the darkening wash applies.
//
// `--tab-bg` is the base every wash mixes onto. Under Glass the surface tokens
// are transparent and the <body> field is what shows through a tab, so the
// base prefers `--glass-field` (styles.css sets it only under glass, on
// `data-glass-field` declarers) and falls back to the tab's own surface token.
const TAB =
'group/tab relative flex shrink-0 items-center border-transparent bg-(--tab-bg) text-[0.6875rem] font-medium [-webkit-app-region:no-drag] [--tab-face:var(--tab-bg)]'
'group/tab relative flex shrink-0 items-center border-transparent bg-(--tab-bg) text-[0.6875rem] font-medium [-webkit-app-region:no-drag] [--tab-face:var(--tab-bg)] [--tab-bg:var(--glass-field,var(--tab-surface))]'
// Full height: with the strip's rule removed there is no last-pixel row to
// leave uncovered, so tabs fill the bar and no sliver of gutter shows through.
@@ -31,7 +36,7 @@ const TAB_CLOSEABLE = 'min-w-13'
const TAB_VERTICAL =
'w-full max-h-48 justify-center not-first:border-t not-first:border-t-(--ui-stroke-quaternary) [writing-mode:vertical-rl]'
const TAB_ACTIVE = 'h-full text-foreground [--tab-bg:var(--pane-tab-active-bg,var(--ui-editor-surface-background))]'
const TAB_ACTIVE = 'h-full text-foreground [--tab-surface:var(--pane-tab-active-bg,var(--ui-editor-surface-background))]'
// Horizontal only: the active tab is the sole seam on the strip — a
// theme-primary underline drawn as an inset shadow in its own last pixel row,
@@ -44,7 +49,7 @@ const TAB_ACTIVE_UNDERLINE = 'shadow-[inset_0_-2px_0_var(--pane-tab-active-accen
// a darkening wash to register at all. `--tab-face` tracks the wash — the same
// mix flattened onto `--tab-bg` — so the close gradient matches what shows.
const TAB_IDLE =
'text-(--ui-text-tertiary) [--tab-bg:var(--pane-tab-strip-bg,var(--ui-sidebar-surface-background))] hover:shadow-[inset_0_0_0_100vmax_color-mix(in_srgb,#000_var(--ui-tab-hover-darken),transparent)] hover:[--tab-face:color-mix(in_srgb,#000_var(--ui-tab-hover-darken),var(--tab-bg))] hover:text-(--ui-text-secondary)'
'text-(--ui-text-tertiary) [--tab-surface:var(--pane-tab-strip-bg,var(--ui-sidebar-surface-background))] hover:shadow-[inset_0_0_0_100vmax_color-mix(in_srgb,#000_var(--ui-tab-hover-darken),transparent)] hover:[--tab-face:color-mix(in_srgb,#000_var(--ui-tab-hover-darken),var(--tab-bg))] hover:text-(--ui-text-secondary)'
// A tab riding a multi-tab selection: an accent wash over whatever surface the
// tab sits on. A background-image gradient (not a shadow) so it stacks cleanly
@@ -117,6 +122,7 @@ export const PaneTab = React.forwardRef<HTMLDivElement, PaneTabProps>(function P
)}
data-active={active}
data-closeable={(onClose && !vertical) || undefined}
data-glass-field=""
data-selected={selected || undefined}
data-vertical={vertical || undefined}
onClickCapture={event => {
+10
View File
@@ -617,6 +617,16 @@
background: color-mix(in srgb, var(--ui-bg-chrome) var(--translucency-glass-keep, 100%), transparent);
}
/* A surface that FADES INTO the field (a pane tab's hover ✕ runway) declares
`data-glass-field` and reads `--glass-field` for its endpoint. Under glass
the surface tokens are transparent, so a fade aimed at one goes
transparent→transparent and the runway vanishes; the field is the <body>
mix above, so that is what a fade must land on. Inert with glass off:
the caller's own fallback (its surface token) applies. */
:root[data-hermes-glass] [data-glass-field] {
--glass-field: color-mix(in srgb, var(--ui-bg-chrome) var(--translucency-glass-keep, 100%), transparent);
}
/* Sidebar scope (the Finder shape): glass rail, opaque content column.
<body> stays the one painter but splits at the rail's visual edge — the
store publishes it as --glass-rail-edge (live-tracked through collapse