ui-ux-color-contrast
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Generate, implement, or review accessible color, contrast, status, state, chart, badge, alert, validation, focus, and brand-surface treatments. Use whenever UI work needs measured WCAG 2.2 AA foreground/background evidence, semantic color tokens, redundant non-color cues, or dark-mode and forced-colors verification.
In this repository46 other files it gives its agents.
- AGENTS.mdAGENTS.md
- academixSkill
- agent-browserSkill
- ai-engineering-platformSkill
- apocalypseSkill
- aria-apg-reviewSkill
- context-budgetSkill
- crawler-readiness-auditSkill
- data-protection-gateSkill
- decision-criticality-gateSkill
- fact-checkerSkill
- find-skillsSkill
- focus-friendly-outputSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- humanizerSkill
- improve-codebase-architectureSkill
- microsoft-foundrySkill
- output-templatesSkill
- pre-launch-security-gateSkill
- prompt-preflightSkill
- quick-recapSkill
- rag-retrieval-qualitySkill
- rest-api-best-practicesSkill
- rigorous-responseSkill
- security-checklistSkill
- shepherdSkill
- skill-optimizerSkill
- sql-query-correctnessSkill
- system-design-scaleSkill
- tddSkill
- ui-ux-component-qualitySkill
- ui-ux-design-systemsSkill
- ui-ux-dropdownsSkill
- ui-ux-form-validationSkill
- ui-ux-generationSkill
- ui-ux-loading-statesSkill
- ui-ux-mobile-cssSkill
- ui-ux-typographySkill
- ux-logic-loopSkill
- ux-pattern-reviewSkill
- vercel-react-best-practicesSkill
- visual-flow-storyboardSkill
- visual-pr-reviewSkill
- web-design-guidelinesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 10 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Test every state independently at responsive sizes, 200% zoom, in grayscale, dark mode, high-contrast or forced-colors mode, and on the …
- Very specific: line 36
Use the 3:1 text threshold only for text at least 24 CSS px at normal weight or about 18.66 CSS px when bold.
- Very specific: line 39
Treat #767676 on #FFFFFF and its approximate 4.54:1 ratio only as a boundary example.
- Distinctive: line 41
Avoid pale secondary text and cutoff-level pairings.
- Distinctive: line 43
Keep disabled controls understandable even when an exception applies.
- Distinctive: line 47
Keep errors, warnings, success, selection, required fields, changes, online state, and chart categories understandable without hue …
- Very specific: line 49
Prefer icon plus consequence-based text plus color for important messages, such as Payment failed, Saved, or 3 fields need attention.
- Distinctive: line 50
Do not rely on placeholder text, border color, a red asterisk, or an unnamed icon alone for requirements or validation.
- Distinctive: line 52
Keep hover, focus, pressed, and selected states distinct.
- Distinctive: line 53
Add labels, direct annotations, patterns, or symbols whenever chart color categories carry meaning.
- Very specific: line 60
Keep palette steps such as brand-100 through brand-900 only when the product needs them.
- Distinctive: line 61
Document approved foreground/background pairings separately for normal text, large text, icons, boundaries, and states.
- Very specific: line 68
Every normal-text pair reaches 4.5:1 unless a documented WCAG exception applies.
- Very specific: line 69
Every qualifying large-text pair reaches 3:1.
- Very specific: line 70
Every required non-text cue reaches 3:1 against its adjacent colors where WCAG requires it.
- Distinctive: line 71
Every status, selection, validation state, and chart category remains understandable in grayscale and without color names.
- Distinctive: line 72
Every error and success treatment includes persistent text or an equivalent semantic cue in addition to color.
- Distinctive: line 73
Default, hover, focus, active, selected, disabled, loading, error, warning, success, visited, dark, and forced-colors states are tested …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI/UX Color Contrast
Measure rendered color pairs and preserve meaning without hue perception. Treat contrast compliance as a baseline, not proof that the typography, hierarchy, wording, or interaction is usable.
Workflow
- Inspect the rendered interface, semantic tokens, component variants, supported themes, real content, and every meaningful state.
- Inventory each foreground/background pair and each meaning encoded by color, including text, icons, boundaries, focus indicators, charts, badges, alerts, and validation.
- Classify each pair as normal text, qualifying large text, meaningful non-text UI, decorative, inactive, or exempt logo content.
- Measure the actual computed colors over the real adjacent surface with a reliable WCAG relative-luminance checker. Include opacity, overlays, gradients, images, video, shadows, and state changes.
- Apply the correct threshold and add a safety margin above the mathematical cutoff.
- Preserve meaning with persistent non-color cues and accessible semantics.
- Test every state independently at responsive sizes,
200%zoom, in grayscale, dark mode, high-contrast or forced-colors mode, and on the weakest supported display or device where practical. - Automate repeatable checks where feasible, retain manual review for complex surfaces and state distinctions, and record the tested pairs, states, ratios, thresholds, cues, and method. Never approve from a screenshot or visual judgment alone.
For review-only requests, report findings without editing. For creation or fix requests, implement the smallest coherent correction and remeasure the rendered result.
Contrast requirements
- Reach at least
4.5:1for normal text against its background. - Use the
3:1text threshold only for text at least24 CSS pxat normal weight or about18.66 CSS pxwhen bold. - Reach at least
3:1for meaningful component boundaries, focus indicators, icons, chart marks, and visual state cues against adjacent colors where WCAG requires them to identify or understand the UI. - Judge each actual foreground/background pair, not its color family. Use white on blue, purple, or another brand color only when that rendered pair passes for the text size and weight.
- Treat
#767676on#FFFFFFand its approximate4.54:1ratio only as a boundary example. Never promote it to a universal gray token or reuse it without fresh measurement. - Specify both foreground and background colors. Never assume inheritance, a browser default, a theme, or an image will preserve contrast.
- Avoid pale secondary text and cutoff-level pairings. Prefer spacing, placement, weight, and grouping over reducing legibility.
- Measure text over gradients, images, translucent layers, or video at the lowest-contrast point, or provide a dependable solid backing layer.
- Keep disabled controls understandable even when an exception applies. Treat logos and decorative content as exempt only when they are not interactive or instructional.
Preserve meaning without color
- Keep errors, warnings, success, selection, required fields, changes, online state, and chart categories understandable without hue perception.
- Pair color with at least one persistent cue such as explicit text, an accessible icon, shape, pattern, underline, border style, checkmark, label, or weight change.
- Prefer icon plus consequence-based text plus color for important messages, such as
Payment failed,Saved, or3 fields need attention. - Do not rely on placeholder text, border color, a red asterisk, or an unnamed icon alone for requirements or validation.
- Associate field errors programmatically and announce important asynchronous status changes without repeated noise.
- Keep hover, focus, pressed, and selected states distinct. Preserve selected-state identification after pointer or keyboard focus moves away.
- Add labels, direct annotations, patterns, or symbols whenever chart color categories carry meaning.
Tokens and components
- Separate brand and neutral palettes from semantic background, surface, text, border, focus, success, warning, error, and information roles.
- Define semantic roles such as
text-primary,text-secondary,surface,border,focus,error,warning,success, andinfo; do not encode meaning only in names such asgray-500orgreen-600. - Let components consume semantic roles and derive light and dark themes by remapping those roles rather than embedding theme-specific colors in each component.
- Keep palette steps such as
brand-100throughbrand-900only when the product needs them. Treat supplied indigo or other example scales as references, never universal defaults. - Document approved foreground/background pairings separately for normal text, large text, icons, boundaries, and states.
- Prevent unsupported token pairings in component APIs where practical. Passing on one surface never implies passing on another.
- Store accessible status treatments as complete components with icon, label, semantics, contrast, and screen-reader behavior rather than as color tokens alone.
- Remeasure after any theme, token, opacity, font, background, state, or brand-palette change.
Acceptance criteria
- Every normal-text pair reaches
4.5:1unless a documented WCAG exception applies. - Every qualifying large-text pair reaches
3:1. - Every required non-text cue reaches
3:1against its adjacent colors where WCAG requires it. - Every status, selection, validation state, and chart category remains understandable in grayscale and without color names.
- Every error and success treatment includes persistent text or an equivalent semantic cue in addition to color.
- Default, hover, focus, active, selected, disabled, loading, error, warning, success, visited, dark, and forced-colors states are tested when applicable rather than inferred from another state.
- Measured evidence identifies the pair, state, computed colors, ratio, threshold, result, non-color cue, and validation method.
Output
Return the requested artifact or prioritized findings first. Then report measured evidence, implemented non-color cues, exact verification, WCAG exceptions, and any state that remains unverified.
Shared output profile
Compose the execution profile for creation or fixes and the review profile for audits from output-templates.
Preserve the measurement evidence and non-color-cue requirements above, omit inapplicable states, and never present screenshots or subjective appearance as contrast proof.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

