Skip to content

Hand the format ring down to the badge that draws it - #208

Merged
vmillet-dev merged 1 commit into
mainfrom
format-ring-is-on-the-badge
Sep 18, 2026
Merged

vmillet-dev merged 1 commit into
mainfrom
format-ring-is-on-the-badge

Conversation

@vmillet-dev

Copy link
Copy Markdown
Owner

Closes #207. Regression from #205, reported from the running app: selecting a format
in the rail left no visible mark.

Cause

#205 moved the ring off the chip and onto the badge, with a rule in the rail's
stylesheet:

.language-chip.on .lang-tag { border-color: var(--amber); }

.lang-tag belongs to app-language-badge. Emulated encapsulation rewrites that
selector with the rail's _ngcontent attribute, so it can never match an element the
badge rendered. Dead rule, no error, no mark.

Fix

hue-badge reads --badge-ring / --badge-surface, each falling back to what it drew
before; the rail sets them on .language-chip. A custom property inherits across the
boundary a rule cannot cross. No visual change beyond restoring the mark — the ring
is still one ring, on the badge, as #201 asked.

Why the test let it through

badgeBoxes asserted outlines === 1 — it counted how many boxes were drawn, and the
badge's own hue hairline from #196 kept that count at 1 while the selection lost its
mark. The new assertion compares the same badge's border colour selected against at
rest, which is language-independent and cannot be satisfied by an unrelated border.

Confirmed to fail on the shipped code before the fix, with the other 21 scenarios of
06-search-and-filters green.

Verified

E2E 21/21 (the mixin is shared with the cards, so the whole suite ran, not just 06),
unit 1354/1354, test:scripts 32/32, lint clean. Visual result checked in the running
app by @vmillet-dev.

A rule written in the rail's stylesheet cannot reach '.lang-tag': that element
belongs to 'app-language-badge', and emulated encapsulation rewrites the
selector with the rail's own '_ngcontent' attribute, so it matches nothing.
The selected format lost its mark entirely.

'hue-badge' now reads '--badge-ring' and '--badge-surface' with its hue as the
fallback, and the rail sets them on the chip: a custom property inherits
across the boundary a rule cannot cross.

The assertion that missed this counted how many boxes were drawn around the
badge, and the badge's own hairline kept that count right. It now compares the
same badge's border colour selected against at rest.

Closes #207
@vmillet-dev
vmillet-dev merged commit 4746670 into main Sep 18, 2026
9 checks passed
@vmillet-dev
vmillet-dev deleted the format-ring-is-on-the-badge branch September 18, 2026 12:34
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.

A selected format has no mark: the rail cannot reach the badge

1 participant