/modern-html:modern-html-native-form-controlsfrom modern-html
Native 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.
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.
Read when SKILL.md points to them.
<form>
<label>Email <input type="email" required></label>
<label>Phone <input type="tel" pattern="[0-9-]{10,}"></label>
<label>Age <input type="number" min="13" max="120" required></label>
<button>Submit</button>
</form>
屬性:required pattern min max minlength maxlength step type.
類型:email url tel number date time datetime-local month week color range.
JS 介面:
form.checkValidity() → bool。form.reportValidity() → bool + UI 報。input.setCustomValidity('msg') → 自定錯。input.validity → ValidityState。'invalid' event 於提交無效時。:user-valid / :user-invalid (乙, 2026-04 Widely ~1月)優於 :valid / :invalid — 待用戶交互後才應,避初載即紅。
input:user-invalid { border-color: oklch(55% 0.2 25); }
input:user-valid { border-color: oklch(55% 0.2 145); }
input:user-invalid + .err { display: block; }
<form novalidate> + 自定 UI 時:JS 仍可問 input.validity.valueMissing。
accent-color (甲, 2025):root { accent-color: oklch(60% 0.18 250); }
染:<input type=checkbox|radio|range> <progress>。OS-honored. 一行省百行。
color-scheme (甲) + form 對齊:root { color-scheme: light dark; }
UA 表單控件 + scrollbar 即從系統色。配 light-dark() 自定色。
<select> (丙) — 避作主MDN 警告:"This feature is not Baseline because it does not work in some of the most widely-used browsers." 部分 JS framework block / SSR hydration fail。
/* 漸進增強,僅支持瀏 */
@supports (appearance: base-select) {
select, ::picker(select) { appearance: base-select; }
}
主用:傳統 <select> + 自定 wrapper,或 popover-based menu(仍乙)。
field-sizing: content (丙, Firefox stable 未) — 漸進textarea, input {
field-sizing: content;
min-inline-size: 10ch;
max-inline-size: 60ch;
min-block-size: 3lh;
}
不支瀏:固定尺寸 fallback(min-* 已給合理 default)。
<input type="date" min="2024-01-01" max="2026-12-31">
<input type="time" step="900"> <!-- 15分 step -->
<input type="datetime-local">
<input type="color" value="#3344ff">
<input type="range" min="0" max="100" step="5" value="50" aria-label="Volume">
注:UA UI 不一。styling pseudo-elements (e.g. ::-webkit-calendar-picker-indicator) 不一致 — 勿依賴。
<label> 必,包 input 或 for+id。aria-describedby 連 input 至錯文字。勿僅靠色(contrast 3:1+)。aria-invalid="true" 於失敗 input。<fieldset> + <legend>。required 自報,可加 aria-required="true" 為冗餘明示。:invalid 紅圈在初載。改 :user-invalid。<div role="combobox"> 取代 <select> — 鍵盤 + a11y 多誤。先試 popover + button。examples/validation.htmlmodern-html:baseline-decision-protocol — 前置 Tier A/B/C 閘;先判可用層,再取此技各特性。modern-html:accessibility-primitives — 表單 label / 錯訊 / focus a11y 深守,配對取用。What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
10 skills in this plugin
/modern-html-accessibility-primitivesNative 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./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-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.npx claudepluginhub standardbeagle/standardbeagle-tools --plugin modern-html