Skip to content

docs: update color spec to document all supported CSS color formats#96

Merged
davideast merged 1 commit into
mainfrom
docs/color-format-spec
Jun 2, 2026
Merged

docs: update color spec to document all supported CSS color formats#96
davideast merged 1 commit into
mainfrom
docs/color-format-spec

Conversation

@davideast
Copy link
Copy Markdown
Collaborator

Closes #53

The linter already supports oklch, oklab, lab, lch, rgb, hsl, hwb, named colors, color-mix, and 8-digit hex alpha. But the spec, README, and error messages all said only hex was accepted. This was blocking adoption for teams using modern CSS color spaces.

Changes

  • spec.mdx (source of truth): Updated the Color type definition to list all supported CSS color formats
  • docs/spec.md: Regenerated via bun run spec:gen
  • README.md: Updated the token types table
  • handler.ts: Updated the linter error message to show oklch and rgb examples instead of just hex

What was already working

The color parser (color-parser.ts) already handles all of these formats with full conversion math. No parser changes needed. This PR is docs-only plus one error message string.

The linter already supports oklch, oklab, lab, lch, rgb, hsl, hwb,
named colors, color-mix, and 8-digit hex alpha. But the spec, README,
and error messages all said only hex was accepted. This was blocking
adoption for teams using modern CSS color spaces (Issue #53).

Update the Color type definition in the spec, the token types table in
the README, the spec.mdx source, and the linter error message to
reflect the full range of supported formats.

Closes #53
@davideast davideast merged commit ef72df6 into main Jun 2, 2026
13 checks passed
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.

Feature request: alpha channels and modern color spaces (OKLCH/P3)

1 participant