This is your reference when you need container queries, `calc-size()` for animating to auto heights, or OKLCH colors instead of HSL. It covers the modern stuff that actually shipped: view transitions, scroll-driven animations, anchor positioning, `text-wrap: balance`, and the new dynamic viewport units. Also handles newer HTML like customizable selects and popover attributes. Reach for this when refactoring old flexbox hacks or when you're starting fresh and don't want to write CSS like it's 2015. The cascade layers section alone will save you from specificity hell on larger projects.

skills.sh installs
559
GitHub stars
4.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add paulirish/dotfiles --skill modern-css --agent claude-code

Installs into .claude/skills of the current project.

Files

Modern CSS

This skill provides a reference for writing modern, robust, and efficient CSS.


Layout & Responsive Design

Container Queries

.card {
  container: --my-card / inline-size;
}

@container --my-card (width < 40ch) {
  /* Component-based responsive design */
}

@container (20ch < width < 50ch) {
  /* Range syntax */
}

Container units: cqi, cqb, cqw, cqh - size relative to container dimensions

Anchored container queries: Style positioned elements based on anchor fallback state

.tooltip {
  container-type: anchored;
}

@container anchored(top) {
  /* Styles when positioned at top */
}

Media Query Range Syntax

@media (width <= 1024px) { }
@media (360px < width < 1024px) { }

Grid Enhancements

  • Subgrid: Inherit parent grid lines for nested layouts
  • Masonry: display: grid-lanes for Pinterest-style layouts with logical tab order. (Previously proposed as grid-template-rows: masonry).

Color & Theming

Color Scheme & Light-Dark Function

:root {
  color-scheme: light dark;
  --surface-1: light-dark(white, #222);
  --text-1: light-dark(#222, #fff);
}

Sponsors

Details

Repository
github.com/paulirish/dotfiles
Categories
Frontend Development, Documentation, Code Review & Quality
First seen
Jun 3, 2026
1plugin87 avatarbrandkitplugin87/ux-ui-agent-skillsGenerate a complete, accessible brand design system from a brief — primitive → semantic → component DTCG tokens (color, type, spacing, radius, shadow, motion), 558skills.sh installs
2storybookjs avatarsetup-react-native-storybookstorybookjs/react-nativeSet up Storybook for React Native in Expo, React Native CLI, or Re.Pack projects. Use when adding Storybook to a project, configuring metro.config.js with withS557skills.sh installs
3freestylefly avatarcanghe-markdown-to-htmlfreestylefly/canghe-skillsConverts Markdown to styled HTML with WeChat-compatible themes. Supports code highlighting, math, PlantUML, footnotes, alerts, and infographics. Use when user a536skills.sh installs
4dylantarre avatarresponsive-adaptivedylantarre/animation-principlesUse when building context-dependent animations - duration that changes based on device, distance, user preference, or interaction context534skills.sh installs
5plugin87 avatarmigrate-design-systemplugin87/ux-ui-agent-skillsMap this token system to or from any external design system (Material Design 3, Apple HIG, Fluent, Carbon, Ant, shadcn/ui, Radix, Chakra, Mantine, Bootstrap…) —531skills.sh installs
6plugin87 avatartoken-buildplugin87/ux-ui-agent-skillsSet up or run the token build pipeline — transform the DTCG tokens/*.json (source of truth) into platform artifacts (CSS variables, Tailwind @theme, JS/TS, iOS 522skills.sh installs