css-containers

Installation
SKILL.md

CSS Containers

A named container query is a dependency between stylesheets: one element is the container, and the parts inside it query its width. In a CSS Modules codebase the names are tokens, as colors and sizes are:

  • every container name is a class in one shared CSS Module, e.g. containers.module.css, and that file is the only place that declares container:;
  • to make an element a container, add its class to the element;
  • a part that follows the width queries the name with @container.

Example

The container names, each with what carries it and what reads it:

/* containers.module.css */

/**
 * A grid of tiles, `Grid variant='tiles'`. Read by Grid and by the tiles,
 * which close up at 420 or less.
 */
Installs
1
First Seen
13 days ago