diff --git a/docs/design-lint.md b/docs/design-lint.md index 7e9e9c928..3afab4870 100644 --- a/docs/design-lint.md +++ b/docs/design-lint.md @@ -176,7 +176,7 @@ as `house-style`. | `missing-states` | ask | 26b | no :active or :disabled state | all the states a control can be in | | `missing-reduced-motion` | blocks | 27 | a keyframe or transform transition without a prefers-reduced-motion fallback | add @media (prefers-reduced-motion: reduce) | | `autoplay-unmuted` | blocks | 28a | a video autoplaying without muted | autoplay muted loop playsinline | -| `lazy-lcp` | blocks | 28a | loading="lazy" on the first image | fetchpriority="high" on the LCP image | +| `lazy-lcp` | blocks | 28a | loading="lazy" on the first image or the hero video | fetchpriority="high" on the LCP image | | `video-without-poster` | ask | 28b | a video without poster or a priority hint | add them | | `input-state-shift` | blocks | 39a | input states that break: a border that changes width, a focus ring built from border, disabled by opacity alone | constant border, outline, shared height, three disabled channels | | `control-height` | ask | 39b | control height outside 44 to 52px on a marketing page | the number | diff --git a/lib/design-lint/rules/ids.ts b/lib/design-lint/rules/ids.ts index 632667c99..7fb77ae53 100644 --- a/lib/design-lint/rules/ids.ts +++ b/lib/design-lint/rules/ids.ts @@ -112,10 +112,10 @@ export const RULES: Record = { 'missing-states': { tier: 'ask', gate: '26b', title: 'no :active or :disabled state', fix: 'all the states a control can be in' }, 'missing-reduced-motion': { tier: 'blocks', gate: '27', title: 'a keyframe or transform transition without a prefers-reduced-motion fallback', fix: 'add @media (prefers-reduced-motion: reduce)' }, 'autoplay-unmuted': { tier: 'blocks', gate: '28a', title: 'a video autoplaying without muted', fix: 'autoplay muted loop playsinline' }, - 'lazy-lcp': { tier: 'blocks', gate: '28a', title: 'loading="lazy" on the first image', fix: 'fetchpriority="high" on the LCP image' }, + 'lazy-lcp': { tier: 'blocks', gate: '28a', title: 'loading="lazy" on the first image or the hero video', fix: 'fetchpriority="high" on the LCP image' }, 'video-without-poster': { tier: 'ask', gate: '28b', title: 'a video without poster or a priority hint', fix: 'add them' }, 'input-state-shift': { tier: 'blocks', gate: '39a', title: 'input states that break: a border that changes width, a focus ring built from border, disabled by opacity alone', fix: 'constant border, outline, shared height, three disabled channels' }, - 'control-height': { tier: 'ask', gate: '39b', title: 'control height outside 44 to 52px on a marketing page', fix: 'the number' }, + 'control-height': { tier: 'ask', gate: '39b', title: 'control height outside 44 to 52px on a marketing page', fix: 'the number', pageOnly: true }, 'content-hidden-at-rest': { tier: 'blocks', gate: '62', title: 'a reveal class hiding content until JavaScript runs', fix: 'visible by default; hide only under a .js class, or animate from visible with @starting-style' }, // ── Assets and access ── 'emoji-decoration': { tier: 'blocks', gate: '30a', title: 'an emoji standing in for an icon', fix: 'one icon library, custom SVG, or typography' }, diff --git a/test/design-lint-color.test.ts b/test/design-lint-color.test.ts index 6a788a701..65575fd50 100644 --- a/test/design-lint-color.test.ts +++ b/test/design-lint-color.test.ts @@ -38,10 +38,8 @@ function lintPage(html: string, name = 'index.html'): { html: string; findings: const byRule = (findings: Finding[], rule: string): Finding[] => findings.filter((f) => f.rule === rule); const lines = (findings: Finding[]): string[] => findings.map(formatFinding); -import { buildContext } from '../lib/design-lint/static'; import { Reporter } from '../lib/design-lint/report'; import { run as runColor } from '../lib/design-lint/rules/color'; -import type { TwItem } from '../lib/design-lint/tailwind'; describe('design-lint colour: purple-blue-gradient (2a, blocks)', () => { test('a single-hue ramp and a repeating pattern are not findings', () => {