Skip to content

fix(segmented): the chosen face is bg.raised — lighter than the track in dark (D-054, Android 0.8.1) - #150

Merged
jlc488 merged 1 commit into
mainfrom
fix/segmented-raised-face
Nov 13, 2026
Merged

jlc488 merged 1 commit into
mainfrom
fix/segmented-raised-face

Conversation

@jlc488

@jlc488 jlc488 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What

The owner's decision on the chosen segment's look (Android guide §10 no. 20), for the web and Android together (D-054).

  • The problem: in the dark theme the chosen segment was bg.default (#09090B), darker than its bg.subtle track (#18181B). The level-1 shadow does not show in dark, so the chosen face read as a hole. Qooroo's full-screen review caught it. The web SegmentedControl and Android DdsSegmentedControl 0.8.0 were the same.
  • New semantic token color.bg.raised (--dds-color-bg-raised, DdsColors.bgRaised, dds_color_bg_raised): white in light, so light looks the same as before, and zinc.800 (#27272A) in dark, one step lighter than bg.subtle. Text on it: text.primary 14.27:1, text.secondary 5.81:1. It is a system value, not one of the backgrounds a product sets (D-053).
  • The chosen segment uses it, in dds-css (so dds-react, dds-solid and dds-vue, which render that CSS) and in DdsSegmentedControl.
  • The shadow stays at level 1, with the 1dp border.strong edge, as the owner decided. Level 2 spreads past the 2dp track gap and looks like a floating card. Guide §10 no. 20 is now settled.

Other options considered (D-054): painting the face with border.default (a line token, and light would turn grey), the track plus overlay.hover-tint (a hovered segment would look the same as the chosen one), and bg.elevated (same zinc.900 as the track in dark).

Release

  • Android 0.8.1 (VERSION_NAME, changelog, guide §10/§12, READMEs).
  • Web: a minor changeset for @devslab/dds-tokens and @devslab/dds-css (fixed group, so the whole web train moves together): a new token is added, and nothing is renamed or removed.
  • Docs: design-system.md/.ko.md token table, preview/index.html, docs/decisions.md D-054, backlog.

Tests

  • tests/foundation-contracts.test.mjs: in both themes bg.raised is lighter than bg.subtle, primary and secondary text are at least 4.5:1 on it, and the checked segment's CSS uses it. Confirmed it fails when the CSS uses bg-default.
  • ColorSchemeTest.aRaisedFaceIsLighterThanTheSubtleTrackAndCarriesText.
  • SegmentedOnDeviceTest: the chosen-face pixel check now expects bgRaised; a new dark test checks that the face is lighter than the track.

Verified locally

  • Web: verify:source:stage1-2 41/41, verify:source:stage3-4 107/107, verify:foundation:core (token and CSS build plus checks), check:android, check-docs-sync, verify:release (pack, publish dry-run, fresh consumer). The built tokens.css has --dds-color-bg-raised: #ffffff / #27272a.
  • Looked at the built CSS rendered in light and dark: the dark chosen face is lighter than the track, and light is unchanged.
  • Android: the full CI command — BUILD SUCCESSFUL; every unit suite 0 failures / 0 errors (ColorSchemeTest 12/12).
  • Device on SM-F971N (Android 17): SegmentedOnDeviceTest 21/21 (failures="0" errors="0" skipped="0"), including the new dark check that the chosen face is lighter than the track. The catalog looked unchanged in light on the phone. I took no dark screenshot on the phone: another session was using it, so the dark look is covered by that pixel test and the web render above.

… in dark (D-054, Android 0.8.1)

In the dark theme the chosen segment was bg.default (#09090B), darker than its
bg.subtle track (#18181B), and the level-1 shadow does not show in dark, so it
read as a hole (found in Qooroo's full-screen review). Web and Android alike.

New semantic token color.bg.raised: white in light (unchanged look), zinc.800
(#27272A) in dark, one step lighter than bg.subtle. Text on it: 14.27:1
primary, 5.81:1 secondary. The chosen segment uses it in dds-css (so react,
solid and vue) and in DdsSegmentedControl (DdsColors.bgRaised). The shadow
stays at level 1, as the owner decided; Android guide §10 no. 20 is settled.

Tests pin it: tokens (raised lighter than subtle, text >= 4.5:1, the CSS uses
it), ColorSchemeTest, and a device test that the dark face is lighter than the
track. Android 0.8.1; a minor changeset for dds-tokens and dds-css.
@jlc488
jlc488 merged commit 9ecb4a7 into main Nov 13, 2026
3 checks passed
@jlc488
jlc488 deleted the fix/segmented-raised-face branch November 13, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant