/css-expert:css-expertfrom css-expert
Modern CSS house style and platform features (cascade layers, design tokens, container queries, OKLCH, popover, anchor positioning, view transitions). Use when writing or reviewing CSS, styling, layout, colour, typography, responsive design or UI components.
Ships in css-expert. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write CSS that leans on the browser: native HTML elements and current CSS features instead of JavaScript, wrapper divs and old workarounds. This file holds the rules and the support picture. The reference files hold patterns and gotchas; read the one that matches the work.
| Working on | Read |
|---|---|
| Layers, tokens, component structure, where a rule belongs | architecture.md |
| Palettes, theming, light/dark, colour variants, contrast | color.md |
| Grid, flex, container queries, fluid type, text wrapping | layout-and-typography.md |
| Dialogs, popovers, menus, tooltips, forms, accordions, motion | interactive-components.md |
| Starting a project's stylesheet | reset.md |
In an existing codebase, follow what is already there: its framework (Tailwind, CSS Modules, styled components), its naming, its tokens, its breakpoints. Bring modern features into that system; do not introduce layers, a new token scheme or a new naming convention unless asked. The house style below is for new stylesheets and for projects that already use it.
Check the project's browser targets if it states any (browserslist, docs). Without stated targets, assume current evergreen browsers and use the support tiers below.
auto-fill, minmax(), clamp(), flex-wrap, container queries). Media queries are for page-level layout and user preferences.| Need | Use | Not |
|---|---|---|
| Modal | <dialog> opened with command="show-modal" | Overlay divs, focus-trap libraries |
| Menu, dropdown, popover panel | popover + anchor positioning | Floating UI/Popper, z-index, click-outside code |
| Disclosure, accordion | <details>, <details name> for exclusive groups | JS toggles, checkbox hacks |
| Enter/exit animation | @starting-style + transition-behavior: allow-discrete | Class toggling with timeouts |
| Component responsiveness | Container queries | Viewport media queries |
| Styling by child or sibling state | :has() | JS-applied state classes |
| Light/dark theme | color-scheme + light-dark() | Duplicated prefers-color-scheme blocks |
| Hover, subtle and alpha colour variants | Relative colour, color-mix() | Hand-picked hex variants |
| Readable text on a dynamic background | contrast-color() | JS luminance checks |
| Auto-growing textarea or input | field-sizing: content | Resize scripts, replica hacks |
| Validation styling | :user-invalid, :user-valid | :invalid (fires before input), JS |
| Optical vertical centring of text | text-box: trim-both cap alphabetic | Uneven padding, line-height fudges |
| Staggered animation | sibling-index() | Inline --i custom properties |
| State and page transitions | View transitions | FLIP libraries |
| Aligning internals across cards | Subgrid | Fixed heights, JS equalisers |
| Scoping styles to a component | @scope with a lower boundary | Deep descendant selectors |
| Full-height sections on mobile | svh / dvh | 100vh |
| Scrollbar styling | scrollbar-color, scrollbar-width, scrollbar-gutter | ::-webkit-scrollbar |
Checked against Chrome 154, Safari 27 and Firefox 157. When this section is more than a few months old, or a feature is not listed, verify with MDN or caniuse via web search before relying on it.
Use freely. Shipped in all three engines. No fallback and no hedging in comments.
@layer, nesting, :has(), :is()/:where(), container size queries and cq* units, subgrid, logical properties, OKLCH, color-mix(), light-dark(), relative colour, @property, clamp()/min()/max(), round(), media query range syntax, svh/dvh/lvh, lh/rlh/cap units, text-wrap: balance, individual translate/rotate/scale, linear() easing, :focus-visible, :user-invalid, inert, scrollbar-gutter, scrollbar-color.popover, invoker commands (command/commandfor), anchor positioning, @starting-style, transition-behavior: allow-discrete, @scope, container style queries on custom properties, :open, <details name>, ::details-content, field-sizing, text-box, sibling-index()/sibling-count(), contrast-color(), shape(), same-document view transitions with view-transition-class.If the project must support Safari before 26 or Firefox before 147, wrap anchor positioning in @supports (position-area: bottom) so popovers keep their default centred position.
Use as an enhancement. Two engines. Fine when the unsupported result is still correct, just plainer.
| Feature | Missing in | Unsupported result |
|---|---|---|
Customisable <select> (base-select) | Firefox | Native select |
text-wrap: pretty | Firefox | Normal wrapping |
| Cross-document view transitions | Firefox | Normal navigation |
| Scroll-driven animations | Firefox | Must gate with @supports; element stays static |
<dialog closedby> | Safari | No light dismiss; add a small click handler |
popover="hint" | Safari | Treated as manual; needs a JS show/hide path |
stretch sizing keyword | Firefox | Declaration dropped; put a fallback before it |
Typed attr() | Safari | Declaration dropped; put a fallback before it |
Do not build on yet. One engine. Use only as decoration, behind @supports, when asked or when its absence is invisible: interpolate-size/calc-size(), scroll-state queries, anchored container queries, if(), @function, CSS carousels (::scroll-marker, ::scroll-button), interestfor, overlay, reading-flow, corner-shape (all Chromium only); display: grid-lanes masonry and random() (Safari only).
Details and examples are in architecture.md.
@layer reset, base, layout, utilities, blocks, exceptions;. Everything goes in a layer. Control priority with layer order, never with specificity tricks or !important.--color-blue-500, --space-4), semantic (--surface-base, --text-primary), component (--button-bg). Name by function, not appearance.__ for inner elements (.card__title). Variants and states use data attributes (data-variant="ghost", data-state="loading"). A component never sets its own outer margin; the parent spaces its children with gap.color-scheme: light dark on :root and light-dark() in semantic tokens.rem for font sizes and for the bounds of any clamp(). Logical properties (margin-inline, padding-block, inset-inline-end) throughout.@container (inline-size > 30rem), @media (width >= 60rem).Apply these with judgement; each prevents a specific failure.
min-height, not height, on anything holding variable content.min-width: 0 on flex and grid children that hold text or media, so they can shrink.repeat(n, minmax(0, 1fr)) when equal columns must not be widened by their content.flex-wrap: wrap on rows whose items could outgrow the container (nav, tags, button groups). Leave it off where wrapping would break the design, and handle overflow there another way.gap for spacing between siblings, not margins.overflow-wrap: break-word wherever user or CMS text lands.max-width: 100%, aspect-ratio to reserve space, object-fit: cover when cropping.var() fallbacks only for optional component properties that a parent may or may not set (var(--flow-space, 1em)). Do not add fallbacks to references to global tokens.:focus-visible style. Never remove an outline without replacing it.@media (prefers-reduced-motion: no-preference). Opacity and colour transitions can stay.rem font sizes, no fixed heights around text.playwright-cli is installed, take screenshots at a narrow and a wide viewport and in both colour schemes, and read computed styles with eval. Otherwise say what was not checked.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dannysmith/claude-marketplace --plugin css-expert