Skip to content

feat(tokens): add color.semantic.warning.border, the warning amber for borders and bars - #223

Merged
dgraciac merged 1 commit into
mainfrom
dgraciac/warning-border
Nov 19, 2026
Merged

dgraciac merged 1 commit into
mainfrom
dgraciac/warning-border

Conversation

@dgraciac

Copy link
Copy Markdown
Member

What and why

Adds color.semantic.warning.border: oklch(62% 0.128 80) (#AE7C02). Consumers reach it as --pharos-color-semantic-warning-border or tokens.color.semantic.warning.border. It is the warning amber for borders and bars, such as the side bar of the upcoming warning Alert.

The existing amber, semantic.warning.fg, is a fill. It reaches only 2.03:1 on surface.card and 1.94:1 on surface.canvas, so a warning bar painted with it fails WCAG 1.4.11. The new token reaches 3.69:1 on surface.card and 3.53:1 on surface.canvas. It is not for text. No existing token changes value.

The value and the name were decided by David on 2026-11-19. The token was born in the Pharos design system artifact first (D23), at version 1795113014-0060. artifact/tokens.json is a verbatim copy of that version, and src/ follows it. node scripts/sync-from-artifact.ts reports no drift.

Changes

  • src/color.tokens.json: the new DTCG token. It is OKLCH and carries a $description.
  • artifact/tokens.json and artifact/README.md: the snapshot, refreshed from artifact 1795113014-0060.
  • tests/wcag-contrast.test.ts: a new non-text contrast block. semantic.warning.border must reach at least 3:1 on surface.card and on surface.canvas.
  • tests/dist-types/consumer.ts: a consumer reads tokens.color.semantic.warning.border. A rename or a removal now breaks verify:dist-types.
  • README.md: the token structure gets a note on warning.border, and the CI line says that border tokens are checked for 3:1.
  • Changeset: minor, because this is a new token.

Pre-merge plan

  1. pnpm build: Style Dictionary compiles, and verify:dist-types passes under bundler, node16 and nodenext.
  2. pnpm test: all tests pass, including the two new 3:1 cases and artifact-sync.
  3. pnpm typecheck, pnpm lint and pnpm format:check pass.
  4. node scripts/sync-from-artifact.ts prints src/ matches the artifact snapshot.
  5. Run npm pack and open the tarball. The token must appear in every output, with the value oklch(62% 0.128 80):
    • dist/styles.css: --pharos-color-semantic-warning-border.
    • dist/index.js and dist/tokens.json: color.semantic.warning.border.
    • dist/index.d.ts: border: string under warning.
    • src/color.tokens.json, which is ./dtcg/color.
  6. Run git diff origin/main --stat. It should show only additions to tokens, tests and docs, and no existing value changed.

The builder ran all six steps locally on this head, which is rebased on main e472e4d.

Post-deploy plan

The consumer is an application that installs @code-sherpas/pharos-tokens from npm. Once the Changesets release publishes the version that carries this change:

  1. Run npm view @code-sherpas/pharos-tokens version and confirm the version carries this changeset in its CHANGELOG.
  2. In a clean directory, run npm pack @code-sherpas/pharos-tokens@<version> and extract it. Check that the token is in every output with the value oklch(62% 0.128 80):
    • dist/styles.css: --pharos-color-semantic-warning-border.
    • dist/index.js: tokens.color.semantic.warning.border.
    • dist/index.d.ts: typed as string.
    • src/color.tokens.json, through the ./dtcg/color export.
  3. Import the published package from a scratch ESM consumer: import { tokens } from '@code-sherpas/pharos-tokens'. Measure the contrast of tokens.color.semantic.warning.border against tokens.color.surface.card and tokens.color.surface.canvas, for example with culori wcagContrast. Expect about 3.69 and 3.53, both at least 3.
  4. Adjacent check: semantic.warning.fg, bg and on keep their previous values in the published tarball.

Pharos «done» checklist

  1. Artifact: updated first. Version 1795113014-0060 has the token in project/tokens.json, with its usage note, and the README covers it in Visual foundations and Recent changes.
  2. npm: pending the release. See the post-deploy plan.
  3. Alexandria design canvas copy: pending. It is updated after the release, from this artifact version.
  4. pharos-react: the token is adopted by the next increment, Alert 2. No component uses it yet.
  5. Notion: the tokens contract and Decisions are updated when this ships.
  6. Task: Alert 1 moves to Done after post-deploy verification.
  7. Consumer: Alert 2 in pharos-react is the waiting consumer.

Order

breakpoint-compact (#221) is already on main. This branch is rebased on main e472e4d (1.2.0), so the next release will be 1.3.0, as the artifact note says.

🤖 Generated with Claude Code

…r borders and bars

oklch(62% 0.128 80) (#AE7C02): 3.69:1 on surface.card and 3.53:1 on
surface.canvas (WCAG 1.4.11), where semantic.warning.fg reaches 2.03:1 and
1.94:1. Born in the Pharos artifact (version 1795113014-0060); snapshot
refreshed verbatim. No existing token changes value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dgraciac
dgraciac added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit d1f7597 Nov 19, 2026
5 checks passed
@dgraciac
dgraciac deleted the dgraciac/warning-border branch November 19, 2026 18:48
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