Add contrast-color() page (accessibility, recommended)#75
Draft
jdevalk wants to merge 1 commit into
Draft
Conversation
New spec page documenting the CSS contrast-color() function, which returns a legible black/white foreground for a dynamic background — newly available across all major engines in April 2026 (Safari 26, Firefox 146, Chrome/Edge 147). Status: recommended. Wires relatedSlugs on color-contrast, forced-colors, and color-scheme; adds the changelog entry and OG images (per-page + count-driven). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying specification-website with
|
| Latest commit: |
b7a9e07
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3bd88cc3.specification-website.pages.dev |
| Branch Preview URL: | https://standards-scan-contrast-colo.specification-website.pages.dev |
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 changed
New spec page: Automatic contrasting colour (
accessibility/contrast-color), documenting the CSScontrast-color()function — pass it a<color>and the browser returns whichever ofblackorwhitecontrasts more, so a dynamic/user-picked/dark-mode background keeps legible text without hard-coded colour pairs or luminance maths in JavaScript.Also:
type: added, 2026-07-04).relatedSlugswired oncolor-contrast,forced-colors, andcolor-scheme.Why now
contrast-color()reached Baseline "newly available" in April 2026 — all three engines now ship it: Safari 26 (Sep 2025), Firefox 146 (Dec 2025), Chrome/Edge 147 (Apr 2026). Verified against MDN BCD (css.types.color.contrast-color). It sits directly beside our existingcolor-contrastpage and is a genuine, shippable modern tool for meeting contrast on dynamic colours.Primary sources
Status justification
recommended, notrequired: a site works fine computing contrast by hand or hard-coding pairs, and the function degrades safely (feature-detect with@supports). But a modern site with dynamic colours should reach for it. Notoptionalbecause it applies broadly wherever colour is set, not just in niche contexts.Checks
npm run buildpasses (157 pages indexed); page present at HTML,.md,/llms.txt, and/checklist/.npm run lint+npm run format:checkclean.🤖 Draft opened by the daily standards scan. Do not merge without human review; do not redeploy the MCP Worker (that's a post-merge human step).