modern-css_skill

This skill helps you adopt modern CSS practices for responsive layouts, color systems, and animations, boosting maintainability and visual quality across
  • Shell

4.3k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill paulirish/dotfiles --skill modern-css

  • SKILL.md15.0 KB

Overview

This skill provides focused expertise for writing modern, high-quality CSS. Use it to start new stylesheets, adopt new CSS capabilities, or refactor legacy styles into resilient, progressive patterns. It emphasizes component-driven design, accessibility, and feature-detection for cross-browser robustness.

How this skill works

The skill inspects layout, color, typography, animation, and component patterns and proposes modern equivalents (container queries, view transitions, scroll-driven animation, etc.). It suggests feature-detection fallbacks and organizes recommendations by capability level (widely available, newly available, limited). It also returns concrete snippets and architecture guidance like cascade layers, @property, and calc-size() usage.

When to use it

  • Starting a new CSS project or component file
  • Refactoring legacy styles to use container queries, CSS color spaces, or cascade layers
  • Adding animations using view transitions or scroll-driven timelines
  • Designing responsive components scoped to their container rather than the viewport
  • Improving accessibility and respecting user preferences (motion, contrast, reduced-motion)

Best practices

  • Progressive enhancement: wrap experimental features in @supports and provide stable fallbacks
  • Use container queries and container units for component-level responsiveness
  • Prefer modern color spaces (OKLCH, display-p3) and color-mix() for consistent theme manipulation
  • Organize code with @layer and logical properties to reduce specificity wars
  • Use @property and calc-size() for type-safe, animatable custom properties and fluid transitions

Example use cases

  • Convert a global breakpoint system into component-scoped container queries for cards or navs
  • Create fluid typography with clamp() and dynamic viewport units for consistent scaling across devices
  • Replace JavaScript height animations with calc-size(auto) and @property for smooth accordion transitions
  • Implement themed design tokens using modern color functions and color-scheme/light-dark fallbacks
  • Add a persistent site nav using view-transition-name and grouped transition classes for smooth page changes

FAQ

Wrap usage in @supports and provide a fallback style. Check Baseline status via MDN or Can I Use and progressively enable features when available.

When should I prefer container queries over media queries?

Use container queries when a component’s layout should adapt to its container size rather than the viewport. Keep media queries for global, viewport-level layout changes.

Can I animate to auto height without JavaScript?

Yes—use calc-size(auto) along with transition on the size property and consider @property for predictable interpolation and type safety.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational