Skip to content

Commit 1703062

Browse files
authored
fix(SelectableCard): a selected card shows a Highlight ring under forced colors (#14029)
* fix(SelectableCard): a selected card rings in Highlight under forced colors Forced colors drop the selection ring's inset shadow and repaint the border, and palette variants draw no border, so a selected card painted the same as an unselected one in Windows High Contrast. Under @media (forced-colors: active) the selected card's ::after layer now draws a 2px ring in the system Highlight color inside its edge (a disabled card gets its own layer). Layout does not move and the focus outline stays its own; normal color modes are unchanged. * fix(SelectableCard): draw the forced-colors ring on the card's own box The ring was a border on the absolutely positioned ::after layer, which scrolls with the content of a fixed-height card (Card makes it overflow: auto), so on a scrolled card the ring crossed the text and left the lower edge unmarked. Under forced colors a selected card now draws a 2px Highlight border on its own box, and its padding gives up the same 2px, so the content does not move. The styles are a separate class, so their unset defaults do not reset the card's border or padding in normal color modes. The disabled card no longer needs a layer of its own. Adds a scrolled fixed-height case to the browser spec. * docs(SelectableCard): FR3 and the changeset name the forced-colors border on the card's edge The forced-colors ring is now the card's own border, so the record and the changeset say so, including the scrolled fixed-height case and its new verification. * fix(SelectableCard): state the zero-padding and themed-border cases of the forced-colors ring A card with zero padding has no padding to give up, so its content area loses the 2px border on each side. A theme that sets the border color on the selectable-card or card target owns that color under forced colors too, as it owns the border elsewhere. FR3, the changeset and the browser spec now cover both; the spec adds a zero-padding case. * Merge origin/main into l0/selectable-card-forced-colors Resolve the SelectableCard record against #14017: keep main's FR1, FR5 and verification table, and re-add the forced-colors sentence on FR3 and the "FR3 (forced colors)" row. * fix(SelectableCard): draw the forced-colors ring on the ::after layer again The border on the card's own box either moved the content (where padding could not absorb it), overrode a caller's padding, or, without the padding give-back, shifted the layout on every toggle; and a theme's border color won over Highlight. The ::after layer takes no space, so a toggle moves nothing, and a theme does not style it, so the ring keeps Highlight under a theme that sets the card's border color. The one gap: on a fixed-height card whose content scrolls, the layer scrolls with that content. FR3, the changeset and the verification row say so. The browser spec adds a themed case and a case that a toggle moves no card. * test(SelectableCard): the toggle case turns the only selected card off With another card still selected, the row keeps its tallest card's height, so a ring that took space would not move anything. Turning the only selected card off makes such a ring change the row's height. * docs(SelectableCard): FR3 states the forced-colors ring in its Invariant, with the narrower theme claim Move the forced-colors sentence from FR3's Basis cell to the end of its Invariant and restore the Basis. A theme can author a ::after block, so the record, comment and changeset now say only that a theme's border color on the card does not reach the layer. The changeset names the scrolled fixed-height case.
1 parent 3db6eff commit 1703062

5 files changed

Lines changed: 307 additions & 26 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] SelectableCard: in forced colors (Windows High Contrast), a selected card now draws a 2px ring in the system Highlight color inside its edge, so the selection stays visible. Before, a selected card painted the same as an unselected one. The ring takes no space, so a toggle moves nothing, and it keeps Highlight under a theme that sets the card's border color. On a fixed-height card whose content scrolls, the ring scrolls with that content. Normal color modes are unchanged.
6+
7+
@cixzhang

0 commit comments

Comments
 (0)