Communitygithub.com

coastdigitalgroup/coastai-skills

Design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

Qu'est-ce que coastai-skills ?

coastai-skills is a Claude Code agent skill that design and implement a systematic color palette that ensures WCAG 2.2 accessibility compliance. Trigger this skill when asked to define brand colors, create UI themes, or establish a visual system for a website.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coastdigitalgroup/coastai-skills/tree/HEAD/website-design/accessible-color-system

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Accessible Color System

Purpose

The Accessible Color System skill provides a methodology for creating color palettes that are visually cohesive and functionally accessible. It moves beyond aesthetic color choice to a structured system of scales, contrast-safe pairings, and semantic application, ensuring that content is perceivable by all users, including those with visual impairments.

Use Cases

  • Establishing a new brand's digital color presence.
  • Auditing and fixing an existing website's accessibility issues related to color.
  • Designing Dark/Light mode themes.
  • Defining semantic colors for feedback (success, error, warning).

When NOT to Use

  • Art-Driven Experiences: Where color is used purely for expression and does not carry functional information (though accessibility is still encouraged).
  • Hard-Coded Legacy Apps: Where the technical debt makes implementing a system of variables impossible (focus on point-fixes instead).
  • Purely Decorative Elements: Elements like background patterns that do not contain text or interactive components (WCAG 1.4.3 doesn't apply here).

Inputs

To generate an accessible color system, you need:

  1. Primary Brand Color: The core color that identifies the brand (e.g., #0055FF).
  2. Neutral Base: A starting point for grays/blacks (e.g., #1A1A1A or a tinted neutral).
  3. Accessibility Target: WCAG Level AA (standard) or AAA (enhanced).
  4. Context of Use: Is this for a high-density dashboard, a marketing landing page, or a utility-first application?

Outputs

  1. Color Scales: Tonal palettes for Primary, Secondary, Neutral, and Semantic colors (usually 10-step scales).
  2. Contrast Matrix: A map of which foreground colors are safe to use on which background colors.
  3. Semantic Mapping: Defined roles for colors (e.g., --color-action-primary, --color-surface-muted).
  4. CSS Custom Properties: A production-ready block of CSS variables, optionally using color-mix() to derive hover/active tints from a single base token instead of hand-picking every state color.

Workflow

1. Generate Tonal Scales

Expand the base colors into scales (e.g., 50 to 900). Use a tool or formula that maintains consistent lightness steps. Working in the OKLCH color space (rather than HSL) produces more perceptually even lightness steps across hues, which makes contrast easier to predict before testing. Tip: Ensure your Primary 500 or 600 is the "brand" version.

2. Define Neutrals

Create a neutral scale. Consider "tinting" the neutrals with a small amount of the primary color (e.g., 2-5%) to create a more cohesive look.

3. Establish Semantic Roles

Assign colors to functional roles:

  • Action: Primary color for buttons, links, and active states.
  • Surface: Backgrounds, cards, and dividers (Neutrals).
  • Content: Text and icons (High-contrast Neutrals).
  • Status: Success (Green), Warning (Yellow/Orange), Error (Red), Info (Blue).

4. Perform Contrast Validation

Test pairings using WCAG formulas (1.4.3, 1.4.11):

  • Normal Text: 4.5:1 for AA, 7:1 for AAA.
  • Large Text (>18pt): 3:1 for AA, 4.5:1 for AAA.
  • UI Components/Icons: 3:1 for AA (non-text contrast, 1.4.11).
  • Focus Indicators: 3:1 against adjacent colors, and the indicator must not be hidden by sticky headers or other content (WCAG 2.2 SC 2.4.11, Focus Not Obscured).

5. Create Pairing Rules

Document which text colors can go on which backgrounds. Example: White text (#FFFFFF) is only safe on Primary 600 or higher.

Decision Rules

  • Legibility First: Function (readability) always overrides aesthetics. If a brand color is too light for text, use a darker variant for the text while keeping the brand color for decorative elements.
  • Avoid Color Alone: Never rely on color as the only way to convey information (e.g., include an icon or text label with an error message).
  • Consistent Lightness: Keep lightness values similar across different hues at the same scale level (e.g., Red 500 and Blue 500 should have similar perceived brightness).

Constraints

  • Responsiveness: Colors must maintain contrast on mobile screens where glare or low-quality displays might reduce visibility.
  • Accessibility: Must meet at least WCAG 2.2 AA standards for all functional elements, including the 2.4.11 requirement that focus indicators remain visible and unobscured.
  • Hierarchy: Use color saturation and contrast to guide the eye; more important elements (CTAs) should have higher visual weight.

Common Failure Patterns

  • Insufficient Contrast: Using light gray text on a white background or white text on a light brand color.
  • Vibrating Colors: Pairing high-saturation colors (like red and green) that cause visual strain.
  • Too Many Colors: Creating a "rainbow" effect that dilutes brand identity and confuses hierarchy.
  • Semantic Misuse: Using "Error Red" for a decorative element, leading to user anxiety.

Validation Criteria

  • Every functional text element has a contrast ratio of at least 4.5:1 against its background.
  • UI components (borders, icons) have at least 3:1 contrast.
  • The system includes a clear scale for primary and neutral colors.
  • Information is never conveyed through color alone.
  • The system is documented using CSS custom properties for portability.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for long-form content, managing readability, vertical rhythm, and information density to ensure a superior reading experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for informational elements that communicate state (Badges) and categorization (Tags) with clarity and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for non-overlay notifications, managing global announcements and contextual inline alerts to communicate system states without interrupting the user's flow.

coastdigitalgroup/coastai-skills

Design and implement a systematic, asymmetrical bento-grid layout framework to organize diverse content types cohesively while maintaining strict visual hierarchy, logical focus order, and responsive flexibility.

coastdigitalgroup/coastai-skills

Design a responsive, mobile-first bottom navigation bar and persistent action dock system for mobile websites and web applications, establishing spatial anchors, tab bar anatomy, badge indicators, thumb-zone ergonomics, safe area inset handling, active/inactive state contrast, and desktop responsive adaptation rules.

coastdigitalgroup/coastai-skills

Design a mobile-first bottom sheet overlay system with configurable detents, drag affordances, safe area padding, responsive desktop modal/popover adaptation, and WCAG AA accessibility compliance.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for secondary navigation trails that provide orientation, context, and one-click access to parent levels in deep information architectures.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for buttons and interactive triggers, managing visual hierarchy, variant logic, and action grouping to ensure clear intent and accessible interaction.

coastdigitalgroup/coastai-skills

Design a systematic framework for date and time selection, managing calendar grids, range pickers, and scheduling interfaces to ensure precision and accessibility.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for modular content containers that maintain hierarchy, structural integrity, and action alignment across variable content and responsive viewports.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for horizontal discovery components, managing navigation affordances, scroll behavior, and accessibility to ensure effective content density without compromising usability.

coastdigitalgroup/coastai-skills

Design a systematic, highly accessible, and developer-friendly UI layout framework for code blocks, snippet showcases, multi-file code tabs, line-highlighting, diff views, and syntax token contrast in technical documentation and developer platforms.

coastdigitalgroup/coastai-skills

Design a systematic framework for global command menus (Cmd+K panels) that combines keyboard-driven navigation, command execution, and shortcut discovery into an accessible, responsive overlay.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for threaded conversations, managing nesting depths, action hierarchies, and community signaling to foster engagement and readability.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for side-by-side comparison interfaces, managing high attribute density and responsive complexity to support informed decision-making.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for user privacy, managing consent banners, preference centers, and persistent privacy controls to balance legal compliance with user trust.

coastdigitalgroup/coastai-skills

Design and implement a systematic, highly accessible, and responsive visual layout framework for conversational chat widgets, live chat boxes, and chatbot panels that ensures clear message scannability, native focus flow, and seamless mobile keyboard adaptation.

coastdigitalgroup/coastai-skills

Design a systematic, accessible, and high-conversion framework for custom select dropdowns and comboboxes, defining anatomy, states, search-filtering, and responsive mobile-adaptive patterns.

coastdigitalgroup/coastai-skills

Design and specify a systematic dark theme framework, establishing rules for elevation-based surface colors, desaturated brand accents, text legibility, and media adaptation to ensure an accessible, low-fatigue experience.

coastdigitalgroup/coastai-skills

Design and implement a systematic framework for progressive disclosure using accordions, ensuring structural integrity, visual affordances, and accessibility across different content densities and devices.

Skills associés