Skip to content

Chips: codeai-next (CADS) brand styles#74003

Open
levadadenys wants to merge 2 commits into
stagingfrom
denys/re/codeai-next-chips
Open

Chips: codeai-next (CADS) brand styles#74003
levadadenys wants to merge 2 commits into
stagingfrom
denys/re/codeai-next-chips

Conversation

@levadadenys

@levadadenys levadadenys commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Before:
Знімок екрана 2026-07-21 о 19 41 40

After:
Знімок екрана 2026-07-21 о 19 39 59

Vertical alignment is a known issue, will be dealt with separately.

What

Adds [data-brand='codeai-next']-scoped styles to the DSCO Chips component, per-component brand-override pattern from #73901 (Tags):

state legacy (code / codeai) bridge would give codeai-next (this PR)
Checked fill --background-brand-teal-primary --background-brand-primary (purple-50) --background-selected-primary
Checked border --borders-brand-teal-primary --border-brand-primary --border-selected-primary
Checked label --text-neutral-white-fixed (always white) white --text-selected-primary
Checked hover/pressed fill --background-brand-teal-strong --background-brand-strong --background-selected-hover (+ matching border/outline)
Pressed fill (unchecked) --background-neutral-tertiary same --background-brand-light
Disabled+checked label white fixed white fixed --text-disabled-neutral-inverse (white in Light, black in Dark)

The selected state is the mode-inverted, cross-family pair from colors_codeAi.css (brand fill + seafoam text in Light; seafoam fill + navy text in Dark) — matches the Figma component spec, which inspects to background/state/selected/primary + text/state/selected/primary.

Everything else resolves correctly through the token bridge (#73701) with no per-component work: default white fill + solid/secondary borders (primary vs secondary chip variants), neutral-tertiary hover, the focus ring and pressed inset outline (legacy teal → --border-brand-primary, the CADS indigo), and the unchecked disabled treatment.

Legacy brands render byte-identically — every new declaration sits under the [data-brand='codeai-next'] scope.

Cascade notes

Each override mirrors its legacy counterpart's selector, so it outranks it by exactly the [data-brand] attribute — no !important. Two subtleties, both commented in the SCSS:

  • The checked override ties in specificity with the legacy checked-hover/checked-active/disabled-checked rules, so the block re-declares those combinations; rule order inside the block mirrors the legacy cascade (disabled last).
  • Checked-pressed sets outline-color only, so the legacy outline: none on disabled chips still wins on style.

Deliberately not in this PR

  • Sizing (the 3rem height / --spacing-p-* padding ramp from the CADS spec) — same separate-pass plan as Tags.
  • Shape: unlike Tags, the chip keeps its full pill radius under CADS (--shape-round), and the legacy 100px radius already renders that — nothing to override.

QA

  • Storybook: Chips story → Brand toolbar → "CodeAI · CADS"; toggle checked/hover/pressed/disabled, flip Light/Dark (selected pair inverts by design). Back to code.org brand to confirm legacy is untouched.
  • Dashboard: any page with chips + ?brand=codeai-next (needs DCDO brand-router-enabled); ?brand-reset=1 to clear.

Testing

  • stylelint + prettier clean (pre-commit hook); dart-sass compile verified the emitted selectors and their specificity against the base rules.
  • No JS/TSX changes; jest Chips tests don't assert styles.

🤖 Generated with Claude Code

Brand-scoped override block for the states the token bridge cannot
express: the checked chip moves to the dedicated mode-inverted
selected-state token pair (instead of the bridge's brand-ramp mapping
of the legacy teal tokens), the pressed fill moves to brand-light, and
the disabled+checked label uses the disabled-inverse token. Legacy
brands render byte-identically; every declaration sits under
[data-brand='codeai-next']. Follows the reference pattern from the
Tags PR (#73901).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@levadadenys
levadadenys requested a review from a team as a code owner July 21, 2026 16:21
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

🖼️ Storybook Visual Comparison Report

✅ No Storybook eyes differences detected!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CodeAI (CADS) brand-specific styling overrides for the DSCO Chips component under [data-brand='codeai-next'], following the established per-component brand override pattern so legacy brands remain byte-identical while CADS checked/pressed/disabled-checked states use CADS semantic tokens.

Changes:

  • Introduces a [data-brand='codeai-next']-scoped override block in chip.module.scss.
  • Updates CADS-specific visual treatments for pressed (unchecked), selected, selected-hover/pressed, and selected-disabled chip states using CADS semantic tokens.
  • Documents cascade/specificity intent in SCSS comments to mirror legacy selector structure without !important.

Comment thread frontend/packages/component-library/src/chips/chip.module.scss
Review hardening: the 2px inset outline already paints over the 1px
border in the pressed state, so no mismatch was visible, but making the
border take the same token removes the reliance on that subtlety (and
any anti-aliased sliver on the pill's curved corners).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@levadadenys

Copy link
Copy Markdown
Contributor Author

Re the Eyes report: the diffs are all in the markdown package's e2e visual tests (basic/sanitization/callout/inline-styles), which this PR doesn't touch — the same markdown / e2e failure is currently hitting staging itself and essentially every open branch, so it's a stale markdown baseline repo-wide, not a regression here. The component-library / eyes job — the one that actually snapshots these components (at the default legacy brand) — passed, which is the byte-identical-legacy guarantee this PR claims.

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.

2 participants