/frontend:cssfrom frontend
CSS conventions, layout systems, and modern patterns for predictable styles through low specificity and explicit cascade control. Useful when writing, reviewing, refactoring, debugging, or understanding stylesheets, SCSS, layout, or responsive design.
Ships in frontend. 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.
Predictability is the highest CSS virtue. If your styles require !important to work, restructure the cascade.
CSS rewards explicit, low-specificity selectors and intentional cascade ordering. Prefer boring, readable patterns over clever one-liners.
${CLAUDE_SKILL_DIR}/references/layout.md]: Flex shorthand values, grid details (subgrid, implicit
rows, alignment), layout patterns${CLAUDE_SKILL_DIR}/references/modern-css.md]: Extended modern CSS patterns and examples${CLAUDE_SKILL_DIR}/references/scss.md]: @forward patterns, module configuration, built-in modules,
file organization${CLAUDE_SKILL_DIR}/references/responsive.md]: Extended responsive design patterns and examples${CLAUDE_SKILL_DIR}/references/methodologies.md]: Methodology patterns and architecture details.error not div.error!important — use cascade layers or restructure selectors instead; only valid use is in a low-priority reset
layer for truly essential styles:where() to zero-out specificity when needed — :where(.card) .title has 0-0-1 specificity:is() with awareness — it takes the highest specificity of its arguments| Use Case | System |
|---|---|
| One-dimensional flow (row or column) | Flexbox |
| Two-dimensional layout (rows AND columns) | Grid |
| Content-driven sizing | Flexbox |
| Layout-driven sizing | Grid |
| Component internals (nav items, card content) | Flexbox |
| Page-level structure, complex arrangements | Grid |
| Items need to wrap naturally | Flexbox |
| Precise placement on named lines/areas | Grid |
Both work together — a grid item can be a flex container and vice versa.
flex shorthand — it sets intelligent defaults. See ${CLAUDE_SKILL_DIR}/references/layout.md for the
full shorthand value tableflex-flow: row wrap combines flex-direction and flex-wrapflex-wrap with a flex basis for responsive layouts without media queries: flex: 1 1 300px wraps items when
they can't maintain 300px minimumdisplay: flex; align-items: center; justify-content: center or margin: auto on a flex childgap over margin hacks — works in both flexbox and gridjustify-content: space-between with wrap — causes orphan gaps; prefer gap + flex-wraprepeat(auto-fit, minmax(250px, 1fr)) is the canonical responsive grid — no media queries neededauto-fit over auto-fill — auto-fit expands columns to fill space; auto-fill keeps empty trackspx widths on grid items — use fr, minmax(), or autogrid-auto-flow: dense fills visual holes — use carefully, it breaks visual/source order alignment (a11y concern)order in ways that break logical reading order${CLAUDE_SKILL_DIR}/references/layout.md for subgrid, implicit rows, alignment shorthands, and negative line
numbersfloat for layout — floats are for wrapping text around imagesflex-wrap, min(), max(), clamp() before reaching for media queries& for pseudo-classes/elements and compound selectors — &:hover, &::before, &.active& for descendant selectors — .card { .title {} } works& is required when the nested selector starts with a type selector — & p {} not p {}@media, @supports, @container) nest directly inside rules:is() wrapping applies in nesting — be aware that specificity may differ from the equivalent unnested
selector@layer)@layer reset, defaults, themes, components, utilities;!important reverses layer order — !important in the lowest layer wins over !important in higher layers@import url('vendor.css') layer(vendor.bootstrap);revert-layer to roll back to the previous layer's value!important in low layers is intentional — it means "this style is essential, don't override"@layer components { @layer buttons, cards; } — access via @layer components.buttons@layer { }) can't be appended to latercontainer-type: inline-size on the wrappercontainer: card / inline-size@container card (width > 400px) { }cqw / cqh — 1% of container width / heightcqi / cqb — 1% of container inline / block sizecqmin / cqmax — smaller / larger of cqi or cqbUse cqi instead of vw for container-scoped fluid values: font-size: clamp(1rem, 2.5cqi + 0.5rem, 2rem)
Design from the inside out — use the right tool for each level:
min()/max()/clamp(): always — baselinecqi/cqw units: component adapts to parentvw/vh/dvh: page-level layout changesprefers-* media queries: color scheme, motion, contrastrem for breakpoints: @media (width >= 45rem) not (min-width: 768px)@media (768px <= width < 1024px)margin-inline-start not margin-leftprefers-reduced-motion, prefers-color-scheme, prefers-contrastwidth: min(100% - 2rem, 75rem); margin-inline: auto — avoid multiple max-width
values at different breakpointsclamp(min, preferred, max) for fonts, spacing, and container widths--step-0: clamp(1rem, 0.5rem + 1.5vw, 1.25rem)vw alone for font size — it blows up on large screens; always pair with clamp() and remcqi instead of vw for container-scoped fluid valuesUse logical properties for layout-sensitive values (margins, padding, borders, text alignment, positioning offsets). Physical properties are fine for visual effects not affected by writing direction (e.g., box-shadow offsets).
left / right → inline-start / inline-endtop / bottom → block-start / block-endwidth / height → inline-size / block-sizemargin-left → margin-inline-startpadding-top → padding-block-starttext-align: left → text-align: startShorthands: margin-block: 1rem 2rem (block-start, block-end); margin-inline: auto (both inline directions).
color-scheme: light dark on :root and use @media (prefers-color-scheme: dark) for
overridesprefers-reduced-motion: reduce, replace a transform, size, or
position change with a short opacity or color transition. WCAG 2.3.3 does not count opacity or color change as motion.
Add the movement only in prefers-reduced-motion: no-preference (progressive enhancement), or remove it in reduce@media (prefers-contrast: more)@media (hover: hover) for hover effects on capable devices; @media (pointer: coarse) for touch
targets (min 44px)img { max-width: 100%; height: auto; display: block; }aspect-ratio + object-fit: cover for hero images:has() SelectorSelect elements based on descendants or siblings — the "parent selector."
body, :root, or * — broad anchors force expensive re-evaluation on every DOM
change>) or sibling (+, ~) combinators inside :has() to limit traversal scope:has() inside :has():has().layout:has(> .sidebar-open) (good) not body:has(.sidebar-open) (bad):root — scope overrides to components--color-text-primary not --dark-gray--color-, --spacing-, --font-var(--button-bg, var(--color-primary))--my-color differs from --My-Color@property for typed, animatable custom properties — enables type checking (invalid values fall back to
initial-value), controlled inheritance (inherits: false), and transitions on custom propertiesview-transition-name must be unique per page at transition timeprefers-reduced-motion: reduce for view transitionsdocument.startViewTransition(() => { /* update DOM */ })@view-transition { navigation: auto; }::view-transition-group(name)box-sizing: border-box globally via resetrem for font sizes and breakpoints — respects user preferencesem for component-relative spacing (padding that scales with font size)clamp() — replace manual breakpoint laddersaspect-ratio over padding hacks for maintaining proportionsmargin: 0 not margin: 0px (except where required: flex: 0 0 0px)opacity: 0.5 not opacity: .5#ebc not #eebbcc@use and @forward only — @import is deprecated (Dart Sass 1.80.0), removed in 3.0.0@use must appear before any rules except @forwardvariables.$primary not global $primary@use 'variables' as * — use sparingly, only for own filesmath.div() for division — the / operator is deprecated- or _@extend — more predictable output; @extend produces unexpected selectors and doesn't work
across media queries@forward re-exports modules, supports prefixing and visibility control. Module configuration uses !default variables
and @use ... with (). See ${CLAUDE_SKILL_DIR}/references/scss.md for @forward patterns, configuration passthrough,
built-in module usage, and file organization conventions.
Use the official migrator: sass-migrator module --migrate-deps entrypoint.scss. For built-in functions only:
sass-migrator module --built-in-only entrypoint.scss.
.card, .nav, .form.card__title, .card__image.card--featured, .card__title--bold.card__header__title is wrong — flatten to .card__title or create a new blockclass="card card--featured"composes: resetButton from './shared.module.css':global(.utility-class) when neededOrganize styles by specificity, low to high: Settings → Tools → Generic → Elements → Objects → Components → Utilities.
Maps naturally to cascade layers: @layer settings, generic, elements, objects, components, utilities;
color: red not color:redWhen writing CSS:
When reviewing CSS:
Bad review comment:
"According to CSS best practices, you should avoid using ID selectors
for styling because they have high specificity."
Good review comment:
"`#header` -> `.header` -- IDs create specificity 1-0-0, difficult to override."
The coding skill governs workflow; this skill governs CSS implementation choices. For SCSS, this single skill covers both CSS and SCSS conventions.
Predictability is the highest CSS virtue. When in doubt, keep specificity low and cascade explicit.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
css-conventions, specificity, layout, scss, responsive-design
npx claudepluginhub xobotyi/cc-foundry --plugin frontend7 skills in this plugin
/accessibilityWeb accessibility discipline: semantic HTML first, ARIA only when needed, keyboard access always. Invoke whenever task involves any interaction with accessible web content -- writing, reviewing, refactoring, or debugging HTML/CSS/JS for WCAG compliance, ARIA usage, keyboard navigation, focus management, screen reader support, or accessible component patterns./frontend-designDecide and verify what a web interface looks like: reuse of the existing design, color, type, layout, controls, states, and interface copy that trace to the product instead of a framework or model default./reactReact component discipline: pure components, minimal state, effects as escape hatches. Invoke whenever task involves any interaction with React code — writing, reviewing, refactoring, debugging, or understanding JSX, hooks, component architecture, state management, or performance optimization./svelteSvelte runes-first reactivity and SvelteKit fullstack conventions. Invoke whenever task involves any interaction with Svelte code — writing, reviewing, refactoring, debugging, or understanding .svelte, .svelte.js, .svelte.ts files and SvelteKit projects./tailwindcssTailwind CSS v4 utility-first discipline: CSS-first configuration, design tokens via @theme, and principled class composition. Invoke whenever task involves any interaction with Tailwind CSS — writing, reviewing, refactoring, debugging, or understanding utility classes, theme configuration, custom utilities, dark mode, or Tailwind integration with frameworks./vueVue 3 conventions, Composition API patterns, SFC structure, reactivity, composables, and TypeScript integration. Invoke whenever task involves any interaction with Vue code — writing, reviewing, refactoring, debugging, or understanding .vue files, composables, and Vue component architecture.Other plugins' skills for the same job