From 54fed1639bf64c8e78324b5475a644dd0583f02c Mon Sep 17 00:00:00 2001 From: freddymeta <170298698+freddymeta@users.noreply.github.com> Date: Mon, 24 Aug 2026 06:52:55 -0700 Subject: [PATCH 01/12] feat(Table): expose theme targets for the sort and filter affordances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both controls render inside their plugins, so a theme could not reach them at all — no class, no data attribute, and no wrapper a consumer can interpose. Adds three targets: astryx-table-sort-button the sort ); diff --git a/packages/core/src/Table/plugins/sortable/useTableSortable.tsx b/packages/core/src/Table/plugins/sortable/useTableSortable.tsx index 5b7e46463782c..5ce3aceeb2ddc 100644 --- a/packages/core/src/Table/plugins/sortable/useTableSortable.tsx +++ b/packages/core/src/Table/plugins/sortable/useTableSortable.tsx @@ -132,21 +132,26 @@ const sortStyles = stylex.create({ ':is(:disabled,[aria-disabled="true"])': 'default', }, font: 'inherit', - color: 'inherit', + // The glyph reads this through `color="inherit"`, so a theme setting a + // colour on `astryx-table-sort-button` reaches the thing it is aiming at. + // The label carries the header's colour itself (see `label`) rather than + // inheriting it from here. + color: colorVars['--color-icon-secondary'], width: '100%', height: '100%', textAlign: 'inherit', borderRadius: radiusVars['--radius-inner'], }, - iconWrapperUnsorted: { - display: 'inline-flex', - opacity: { - default: 0.35, - ':is(th:hover *)': 1, - ':focus-visible': 1, - }, + buttonSorted: { + color: colorVars['--color-accent'], }, - iconWrapperActive: { + // The header text belongs to the cell, not to the affordance. It is pinned + // to the token the `` sets so the button's icon colour cannot bleed into + // it — without this, colouring the sort target repaints the header label too. + label: { + color: colorVars['--color-text-secondary'], + }, + iconWrapper: { display: 'inline-flex', }, rank: { @@ -310,25 +315,16 @@ function SortHeaderButton>({ type="button" {...mergeProps( themeProps('table-sort-button', {direction}), - focusOutlineProps.focusVisible(sortStyles.button), + focusOutlineProps.focusVisible( + sortStyles.button, + direction != null && sortStyles.buttonSorted, + ), )} aria-label={ariaLabel} onClick={handleClick}> - {children} - - + {children} + + {rank != null && (