/modern-html:modern-html-accessibility-primitivesfrom modern-html
Native a11y primitives — focus-visible, focus-within, inert, prefers-reduced-motion, prefers-color-scheme, prefers-contrast, forced-colors, accessibility-tree for dialog/popover/anchor-positioning, ARIA labeling. Use when: focus styles, keyboard nav, animating UI, picking colors, modal/popover content, auditing component a11y. Skip: backend code, non-rendered content.
Ships in modern-html. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
:focus-visible (甲):focus { outline: none; } /* 僅免於非鍵焦 */
:focus-visible { outline: 2px solid AccentColor; outline-offset: 2px; }
替傳統 :focus 樣式。鍵 focus 才示,鼠 click 不示(瀏覽器啟發判定)。
注:outline: none 無 :focus-visible 配 = a11y 罪。必配對。
:focus-within (甲).field:focus-within { background: oklch(95% 0 0); }
.menu:focus-within { display: block; }
親或後代 focus 即應。配 :has() 更靈。
inert (甲, 2025-10 Widely 7月)<main inert>...</main>
效:移自 a11y tree + tab order + 點擊禁。<dialog>-modal 自 inert 餘頁。手用:自定 modal、SPA route swap、drawer scrim。
@media (prefers-reduced-motion: no-preference) {
.hero { animation: fade-in 0.3s; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
律:opt-in to motion (no-preference 內加)。勿 opt-out。安於 UA default 為 reduce、用戶後設者。
JS:window.matchMedia('(prefers-reduced-motion: reduce)').matches.
prefers-color-scheme (甲)見 theming-and-color/SKILL.md. 配 light-dark() 雙保。
prefers-contrast (甲)@media (prefers-contrast: more) {
:root { --bg: #fff; --fg: #000; --brand: #003eb3; }
.border-subtle { border-color: currentColor; }
}
forced-colors (甲)@media (forced-colors: active) {
.btn-icon::before { forced-color-adjust: auto; }
.decorative { display: none; }
}
system colors:ButtonText ButtonFace LinkText Canvas CanvasText Highlight HighlightText.
Windows High Contrast + Forced Colors 模式皆用。
<dialog> modalaria-labelledby 指 inner heading id;或 aria-label。role="dialog"。<form method="dialog">、dialog.close()、ESC(requestClose() 觸 cancel)。aria-describedby(tooltip 語)或 aria-controls + aria-haspopup(menu 語)。popover=auto)。role="tablist" + aria-label.role="tab" aria-selected="true|false" aria-controls="panel-id" tabindex="0|-1" (roving).role="tabpanel" aria-labelledby="tab-id" tabindex="0".<details>)<details name="g"> 仍鍵盤 + SR 通。accent-color 改 native control 色 — 仍須驗 contrast。≥ 24×24 CSS px (WCAG 2.2 SC 2.5.8 minimum)。豪選 ≥ 44×44 (Apple HIG)。
padding 或 min-block-size/min-inline-size 達標。
tabindex 改變應極稀。flex-direction: row-reverse、grid 重排 — 視覺與 DOM 異。慎。outline: 0 無 :focus-visible 配對。tabindex > 0 — 破自然序。aria-hidden="true" 於可 focus 元素 — 焦至不可名。popover 先。prefers-reduced-motion 守。modern-html:baseline-decision-protocol — 前置 Tier A/B/C 閘;先判可用層,再取此技各特性。modern-html:native-form-controls — 表單控件 a11y 之源,配對取用。What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub standardbeagle/standardbeagle-tools --plugin modern-html10 skills in this plugin
/modern-html-baseline-decision-protocolBaseline-tier decision tree for HTML/CSS/DOM Tier A Widely-9mo auto-adopt, Tier B Newly prompt, Tier C Limited avoid sans fallback. Use when: writing CSS/HTML, picking UI pattern, replacing JS lib, choosing layout/animation primitive, before popover/dialog/container-queries/anchor-positioning/view-transitions/scroll-driven-animations/color-mix/oklch/:has(). Skip: non-UI code./modern-html-css-architectureCascade layers (@layer), @scope at-rule, native CSS nesting for stylesheet structure, specificity, component scoping, replacing BEM/CSS-Modules. Use when: new design system, migrating off Sass mixins, organizing token layers, specificity battles, scoping component CSS sans build step. Skip: single-file demo or prototype, architecture overhead not worth it./modern-html-js-replacement-patternsReplace JS UI libs with native HTML/CSS — modal, tooltip, popover, dropdown, accordion, tabs, carousel, sticky, smooth-scroll, form-validation, lazy-load, line-clamp. Use when: replacing/evaluating Floating UI, Popper, Headless UI, Radix, Reach, Tippy, Swiper, GSAP, Framer Motion, IntersectionObserver libs; building UI primitives; removing JS from frontend. Skip: backend code, non-UI domain./modern-html-modern-css-layoutContainer queries, container query units (cqw/cqh/cqi/cqb), subgrid, :has() relational selector for responsive component-driven sizing. Use when: cards/sidebars/dashboards/responsive components, grandchild row alignment across siblings, styling parents by descendants, replacing viewport media queries with component-aware. Skip: static single-viewport layout, Baseline-Widely-3yr-only project./modern-html-native-form-controlsNative form/input/validation/picker/auto-size — constraint validation (required, pattern, type-inputs), :user-valid/:user-invalid, accent-color, color-scheme, customizable select Limited, field-sizing:content. Use when: login/signup/search/data-entry forms, validation styling, tinting checkbox/radio/range/progress, auto-grow textarea, replacing JS form libs. Skip: read-only display, no inputs./modern-html-native-html-primitivesNative dialog/popover/tooltip/accordion/disclosure/search/lazy-img/command-buttons — dialog (showModal, ::backdrop, requestClose), Popover API (popover, popovertarget, auto/manual/hint), details/summary name attr exclusive accordion, inert, loading=lazy, command/commandfor. Use when: dialog/modal, tooltip/dropdown, FAQ/accordion, search landmark, defer offscreen images. Skip: CSS-only, non-HTML.