Build native web components for web apps using declarative Shadow DOM, CSS-first interactivity, responsive units, and baseline 2025->2024->2023 features...
A skill for building framework-free web components using only native HTML, CSS, and modern browser platform features. It prioritizes Declarative Shadow DOM (DSD), CSS-first interactivity, and the newest baseline features (2025 → 2024 → 2023) to ensure compatibility across the latest four stable browser versions.
<template shadowrootmode="open">.details, popover, dialog, :has()).<my-card>
<template shadowrootmode="open">
<style>
:host {
display: block;
container-type: inline-size;
padding: 1rem;
}
</style>
<slot></slot>
</template>
<h2>Card title</h2>
</my-card>
attachShadow().popover, dialog) instead of custom modals.@scope and @layer to prevent style leakage.@scope, ::details-content, view-transition-class, scrollend, content-visibility@starting-style, transition-behavior, light-dark(), text-wrap: balance, @property:has(), subgridUse the full matrix in references/baseline-features.md.
instructions/skills/dev-native-web-components/
SKILL.md
references/
baseline-features.md
declarative-shadow-dom.md
slot-patterns.md
forms.md
responsive-design.md
css-first-patterns.md
popover-dialog.md
view-transitions.md
accessibility.md
performance.md
debugging.md
validation-checklist.md
css.md
html.md
examples/
card-component/
popover-menu/
responsive-grid/
accordion/
scope-details/
view-transitions/
has-subgrid/
card-component/ - DSD card with container queriespopover-menu/ - Popover navigation menuresponsive-grid/ - Container query grid layoutaccordion/ - Details/summary accordionscope-details/ - @scope and ::details-content FAQview-transitions/ - Minimal view transition togglehas-subgrid/ - :has() + subgrid spec tableplaywright-testing skill for component testing. See debugging.md.| Reference | Description |
|---|---|
| dev-web-app | PWA, SEO, accessibility, i18n, performance, security |
| baseline-features.md | Baseline feature matrix (2025/2024/2023) |
| declarative-shadow-dom.md | DSD patterns and SSR hydration |
| slot-patterns.md | Slot deep dive, slotchange, nested slots |
| forms.md | Forms in Shadow DOM, ElementInternals |
| css-first-patterns.md | CSS-only interactivity patterns |
| responsive-design.md | Container queries, responsive units |
| popover-dialog.md | Native overlays decision tree |
| view-transitions.md | SPA and MPA view transitions |
| accessibility.md | Component accessibility patterns |
| performance.md | Component performance optimization |
| debugging.md | Debugging with Playwright MCP and DevTools |
| validation-checklist.md | Pre-commit validation checklist |
| css.md | Deep CSS research sources |
| html.md | Deep HTML research sources |