diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-22 14:38:16 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-22 14:38:16 -0500 |
| commit | 5f9b72d8311ff1b197ebdc5cff88255863bba15c (patch) | |
| tree | 55957ee77367eef6571f8db19a50a246c85ec7cb | |
| parent | d93937c87d46f45f7c108712fc1b738eda77ae23 (diff) | |
| download | rulesets-5f9b72d8311ff1b197ebdc5cff88255863bba15c.tar.gz rulesets-5f9b72d8311ff1b197ebdc5cff88255863bba15c.zip | |
docs(skills): gate accessibility and bound aesthetics in frontend-design
Two audit fixes. Accessibility moves from an optional reference for interactive components to a required WCAG 2.2 gate before handoff, covering keyboard, focus visibility and not-obscured, target size, contrast, reduced motion, labels, and semantics, for all frontend work. references/accessibility.md gained the backing detail and moved from 2.1 to 2.2. A new "creative but bounded" section keeps the maximalist directions as tools within guardrails: domain fit, readability, responsive stability, and no decoration that degrades the workflow.
| -rw-r--r-- | frontend-design/SKILL.md | 34 | ||||
| -rw-r--r-- | frontend-design/references/accessibility.md | 13 |
2 files changed, 42 insertions, 5 deletions
diff --git a/frontend-design/SKILL.md b/frontend-design/SKILL.md index 81bcc04..cfebc7a 100644 --- a/frontend-design/SKILL.md +++ b/frontend-design/SKILL.md @@ -41,6 +41,17 @@ Interpret creatively and make unexpected choices that feel genuinely designed fo Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision. +### Creative but bounded + +The bold directions above — gradient meshes, heavy texture, overlap, custom cursors, maximalist density — are tools, not obligations. They earn their place only when they serve the work. Creativity here means making a striking, intentional choice *within* these guardrails, not reaching for decoration by default: + +- **Domain fit.** The aesthetic answers to the purpose and audience. A marketing-style gradient-and-orb treatment on an operational dashboard, a data table, or a settings panel is a mismatch, not a flourish. Pick the direction the task earns; an editorial poster and a trading console want different intensities. +- **Readability first.** Type stays legible, contrast stays above the floor (see the accessibility gate below), and nothing overlaps text into illegibility. A single-hue palette that collapses hierarchy, or an overlap that buries a label, is a defect even when it looks bold in a still frame. +- **Responsive stability.** The composition holds across viewports without content jumping, clipping, or reflowing into chaos. A layout that only works at one width isn't finished. +- **No effect that degrades the workflow.** Decorative blobs, orbs, animated backgrounds, custom cursors, and grain overlays come out the moment they slow the task, distract from the primary action, or fight the content for attention. The effect serves the user's goal or it goes. + +Maximalism is still on the table — but it's deliberate density that stays usable, not noise. When a generic gradient, a decorative orb, or a texture is doing nothing for the task, that's AI slop wearing a costume. Cut it. + --- ## Workflow (Added) @@ -49,17 +60,32 @@ For non-trivial work, walk these four phases. Load the referenced files only whe 1. **Intake** — see [references/workflow.md](references/workflow.md) for the question set. Establishes purpose, audience, operational context, functional priorities, technical constraints, brand references, success criteria. 2. **Commitment** — same file: pick one archetype from the list in *Design Thinking* above, state what you're trading away, lock font pairing / palette / motion philosophy / layout approach as one-line decisions. -3. **Build** — code it. Keep the chosen direction visible in every choice; the aesthetic guidance above applies here. Pull [references/responsive.md](references/responsive.md) if the component is layout-significant, [references/accessibility.md](references/accessibility.md) for interactive pieces. -4. **Review** — see [references/design-review.md](references/design-review.md). Self-audit against the archetype and the anti-pattern list before handoff. Emit a short rationale using [references/rationale-template.md](references/rationale-template.md) so the next iteration has context. +3. **Build** — code it. Keep the chosen direction visible in every choice; the aesthetic guidance above applies here. Pull [references/responsive.md](references/responsive.md) if the component is layout-significant, and [references/accessibility.md](references/accessibility.md) for the detail behind the gate below. Build accessibly as you go rather than retrofitting at the end. +4. **Review** — see [references/design-review.md](references/design-review.md). Self-audit against the archetype and the anti-pattern list, then clear the accessibility gate below before handoff. Emit a short rationale using [references/rationale-template.md](references/rationale-template.md) so the next iteration has context. + +For **simple component tweaks, quick polish, or one-line style changes**, skip the workflow — apply the aesthetic guidance inline. Accessibility still applies: a change that touches focus, contrast, target size, motion, or labeling clears the relevant gate items below before it ships. + +## Accessibility Gate (required before handoff) + +Accessibility is a baseline for *all* frontend work, not a feature reserved for interactive components — static pages, layouts, and styling passes are in scope too. Target WCAG 2.2 AA by default (AAA on specific criteria for regulated contexts — confirm with the user). Clear every item before handoff; [references/accessibility.md](references/accessibility.md) carries the implementation detail. + +- **Keyboard operation** — every interactive element reachable and operable with the keyboard alone (Tab / Shift-Tab / Enter / Space / Esc / arrows). No keyboard traps; you can Tab out of every modal and menu. +- **Focus visibility** — a visible focus indicator on every focusable element (`:focus-visible`, ≥ 3:1 against its background). Don't strip the ring without a replacement. +- **Focus not obscured** (WCAG 2.2) — the focused element isn't hidden behind sticky headers, footers, or overlays. Scroll the focused control into a clear view. +- **Target size** (WCAG 2.2) — interactive targets are at least 24x24 CSS pixels, or have enough spacing to clear the equivalent. Decorative density doesn't excuse cramped tap targets. +- **Contrast** — text and UI components meet AA thresholds (4.5:1 normal text, 3:1 large text and component boundaries). Check the worst-case point under gradients and atmospheric effects, after the effect is applied. +- **Reduced motion** — `prefers-reduced-motion` honored for animation, transition, parallax, autoplay, and scroll-triggered reveals. +- **Labels** — every form field has a visible label (placeholder is not a label); icon-only controls have an accessible name; errors are programmatically associated. +- **Semantic structure** — native elements and landmarks over `div`-with-role; one `<h1>` with no skipped heading levels. -For **simple component tweaks, quick polish, or one-line style changes**, skip the workflow — apply the aesthetic guidance inline. +For a ship-bound build, run Lighthouse + axe and fix CRITICAL and SERIOUS findings on top of this manual pass. ## References (Added) | File | Load when | |---|---| | [workflow.md](references/workflow.md) | Starting a new interface / non-trivial redesign | -| [accessibility.md](references/accessibility.md) | Building interactive components; accessibility audit | +| [accessibility.md](references/accessibility.md) | Any frontend build — detail behind the required Accessibility Gate (keyboard, focus, target size, contrast, motion, labels, semantics) | | [responsive.md](references/responsive.md) | Layout-significant component or page; multi-viewport concerns | | [design-review.md](references/design-review.md) | Review phase; auditing existing frontend code | | [rationale-template.md](references/rationale-template.md) | Emitting a `design-rationale.md` alongside the build | diff --git a/frontend-design/references/accessibility.md b/frontend-design/references/accessibility.md index 2b0ca66..96d45ff 100644 --- a/frontend-design/references/accessibility.md +++ b/frontend-design/references/accessibility.md @@ -1,6 +1,6 @@ # Accessibility -Default target: WCAG 2.1 AA. For government, healthcare, finance, or other regulated contexts: AAA on specific criteria (verify with the user). Don't wait for a retrofit — apply during build. +Default target: WCAG 2.2 AA. For government, healthcare, finance, or other regulated contexts: AAA on specific criteria (verify with the user). Don't wait for a retrofit — apply during build. This is a baseline for all frontend work, not just interactive components. ## Color Contrast @@ -30,6 +30,15 @@ Default target: WCAG 2.1 AA. For government, healthcare, finance, or other regul - Custom focus styles need ≥ 3:1 contrast against the adjacent background - `:focus-visible` (not `:focus`) for keyboard-only focus rings — lets mouse clicks stay clean without losing keyboard clarity +**Focus not obscured (WCAG 2.2):** +- A focused element must not be fully hidden behind sticky headers, footers, or other overlays. Sticky top bars are the usual culprit — they cover the control the user just tabbed to. +- `scroll-margin-top` on focusable elements, or `scroll-padding-top` on the scroll container, keeps the focused item clear of a fixed header. + +**Target size (WCAG 2.2):** +- Interactive targets are at least 24x24 CSS pixels, or have enough surrounding spacing that a 24px circle centered on the target doesn't overlap a neighbor's. +- Exceptions: inline links in a sentence, targets sized by the user agent, or an equivalent control of adequate size elsewhere on the page. +- Dense or maximalist layouts don't get a pass — cramped tap targets fail on touch and for users with motor impairments. + ## Semantic HTML Prefer native elements over `<div role="button" tabIndex="0" onClick={...}>`. Native buttons, links, form controls, and landmarks come with keyboard behavior, focus management, and screen reader semantics for free. @@ -88,6 +97,8 @@ Override per-element for critical motion (a loading spinner should still spin, j - [ ] All text meets contrast (spot-check worst-case regions) - [ ] Tab order matches visual order; all interactive elements reachable - [ ] Visible focus ring on every focusable element +- [ ] Focused element isn't hidden behind a sticky header/footer/overlay +- [ ] Interactive targets meet the 24x24px minimum (or have clearing spacing) - [ ] Semantic HTML used where a native element exists - [ ] Icon-only buttons have `aria-label` or visible text - [ ] Form fields have labels; errors are associated |
