Repository navigation
feat(tokens): add color.semantic.warning.border, the warning amber for borders and bars - #223
Merged
Merged
Conversation
…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>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Adds
color.semantic.warning.border:oklch(62% 0.128 80)(#AE7C02). Consumers reach it as--pharos-color-semantic-warning-borderortokens.color.semantic.warning.border. It is the warning amber for borders and bars, such as the side bar of the upcoming warningAlert.The existing amber,
semantic.warning.fg, is a fill. It reaches only 2.03:1 onsurface.cardand 1.94:1 onsurface.canvas, so a warning bar painted with it fails WCAG 1.4.11. The new token reaches 3.69:1 onsurface.cardand 3.53:1 onsurface.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.jsonis a verbatim copy of that version, andsrc/follows it.node scripts/sync-from-artifact.tsreports no drift.Changes
src/color.tokens.json: the new DTCG token. It is OKLCH and carries a$description.artifact/tokens.jsonandartifact/README.md: the snapshot, refreshed from artifact1795113014-0060.tests/wcag-contrast.test.ts: a new non-text contrast block.semantic.warning.bordermust reach at least 3:1 onsurface.cardand onsurface.canvas.tests/dist-types/consumer.ts: a consumer readstokens.color.semantic.warning.border. A rename or a removal now breaksverify:dist-types.README.md: the token structure gets a note onwarning.border, and the CI line says that border tokens are checked for 3:1.Pre-merge plan
pnpm build: Style Dictionary compiles, andverify:dist-typespasses under bundler, node16 and nodenext.pnpm test: all tests pass, including the two new 3:1 cases andartifact-sync.pnpm typecheck,pnpm lintandpnpm format:checkpass.node scripts/sync-from-artifact.tsprintssrc/ matches the artifact snapshot.npm packand open the tarball. The token must appear in every output, with the valueoklch(62% 0.128 80):dist/styles.css:--pharos-color-semantic-warning-border.dist/index.jsanddist/tokens.json:color.semantic.warning.border.dist/index.d.ts:border: stringunderwarning.src/color.tokens.json, which is./dtcg/color.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-tokensfrom npm. Once the Changesets release publishes the version that carries this change:npm view @code-sherpas/pharos-tokens versionand confirm the version carries this changeset in its CHANGELOG.npm pack @code-sherpas/pharos-tokens@<version>and extract it. Check that the token is in every output with the valueoklch(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 asstring.src/color.tokens.json, through the./dtcg/colorexport.import { tokens } from '@code-sherpas/pharos-tokens'. Measure the contrast oftokens.color.semantic.warning.borderagainsttokens.color.surface.cardandtokens.color.surface.canvas, for example with culoriwcagContrast. Expect about 3.69 and 3.53, both at least 3.semantic.warning.fg,bgandonkeep their previous values in the published tarball.Pharos «done» checklist
1795113014-0060has the token inproject/tokens.json, with its usage note, and the README covers it in Visual foundations and Recent changes.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