Skip to content

chore: add css-containers and css-light-dark skills - #211

Merged
dangreen merged 4 commits into
mainfrom
chore/css-containers-light-dark-skills
Nov 19, 2026
Merged

dangreen merged 4 commits into
mainfrom
chore/css-containers-light-dark-skills

Conversation

@dangreen

@dangreen dangreen commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Two new skills, in the shape of css-mixin.

css-containers

Named container queries in a CSS Modules codebase:

  • Every container name is a class in one shared CSS Module, containers.module.css, the only place that declares container:. The element that is the container takes the class from its markup, and parts query the name with @container.
  • The names are global: Lightning CSS hashes a container's name per module and has no way to refer to one from another file, so the skill sets cssModules: { container: false }.
  • A name is a token named by its role, never after a component or a block, in kebab-case with a camelCase class (.cardBody makes card-body).
  • An element measuring itself for its own parts alone stays an unnamed container-type.

css-light-dark

The light and dark theme rules move here out of ui-component: color tokens as light-dark() pairs on :root with color-scheme, a forced scheme for a theme switch or a preview toolbar, and a theme class with its own palette for widgets on someone else's page. It adds the Lightning CSS setting that keeps light-dark() native in the build (exclude: Features.LightDark), and a site's own theme switch for server-rendered pages: the choice kept in localStorage, set on the root by an inline script in the head before the stylesheets arrive, followed across tabs, with pictures drawn for one theme hidden by data-theme.

ui-component drops that section; the README lists both new skills.

🤖 Generated with Claude Code

Move the light and dark theme rules out of the ui-component skill into
css-light-dark, which also shows how to keep `light-dark()` native through
Lightning CSS, and point ui-component to both new skills.
@dangreen
dangreen merged commit 0c8eb30 into main Nov 19, 2026
6 checks passed
@dangreen
dangreen deleted the chore/css-containers-light-dark-skills branch November 19, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant