
Modern Css
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-codeInstalls 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-lanesfor Pinterest-style layouts with logical tab order. (Previously proposed asgrid-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