enhancing-progressively
CSS-first approach - use CSS before JavaScript. Triggers: レイアウト, スタイル, 位置, アニメーション, 表示/非表示, トグル, レスポンシブ, CSS Grid, Flexbox, transforms, transitions, CSSのみ, JavaScript不要, シンプル
When & Why to Use This Skill
This Claude skill implements a CSS-first approach to web development, prioritizing progressive enhancement by utilizing native HTML and modern CSS before resorting to JavaScript. It helps developers build high-performance, accessible, and maintainable user interfaces by leveraging browser-native features like CSS Grid, Flexbox, and advanced selectors for layouts, animations, and interactive states.
Use Cases
- Developing responsive web layouts and complex positioning using CSS Grid and Flexbox instead of JavaScript-based calculations.
- Creating interactive UI components such as toggles, dropdowns, and modals using CSS pseudo-classes like :checked, :has(), and the native <dialog> element.
- Implementing smooth, high-performance animations and transitions using CSS @keyframes to minimize main-thread JavaScript execution.
- Refactoring legacy JavaScript-heavy styling logic into modern, lightweight CSS alternatives to improve page load speed and SEO.
| name | enhancing-progressively |
|---|---|
| description | > |
| allowed-tools | [Read, Grep, Glob] |
| user-invocable | false |
Progressive Enhancement
Priority
| Priority | Approach | Examples |
|---|---|---|
| 1 | HTML | Semantic elements, native inputs |
| 2 | CSS | Grid, Flexbox, :has(), transitions |
| 3 | JS | Only when truly necessary |
Detection
| JS Pattern | CSS Alternative |
|---|---|
element.style.display |
CSS :has(), [open], <dialog> |
addEventListener('resize') |
CSS @media, clamp(), min() |
getBoundingClientRect |
CSS Grid, Flexbox, gap |
setInterval for animation |
CSS transition, @keyframes |
classList.toggle |
CSS :checked, :target |
scrollTo, scrollIntoView |
CSS scroll-behavior: smooth |
matchMedia |
CSS @media, @container |