/frontend-css:scss-modulesfrom frontend-css
House rules for authoring component SCSS — the .scss-over-.css convention, SCSS file structure, the color/spacing/radius variable & token system (never hardcode hex or magic numbers — add to variables first), and BEM structure (block → &__element → &--modifier). Use when writing or refactoring a component's styles, setting up the SCSS token/variable system, or consolidating hardcoded values to the scale. NOT for choosing a dimensional unit or converting px→rem (frontend-css:rem), naming a component's folder or its non-style files (frontend-react:component-structure), style import-alias policy (frontend-js:conventions), LWC/Aura styling (salesforce:lwc_development), or skeleton/Storybook files.
Ships in frontend-css. 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.
In: a component's SCSS being written or refactored, or setting up the SCSS token/variable system.
Out: styles live in .scss with colours from $color-*, spacing/radius from the scale, sizes in
rem, BEM structure, and any absolute positioning justified — new tokens added to the variables file
first. The checkable expectations are in evals/rubric.json.
If the project doesn't already use SCSS and the user has their own bundler (Vite, Webpack, Next.js, etc.) and is not in a Salesforce / LWC / Aura ecosystem:
→ Propose switching to SCSS before writing any styles.
Suggest this structure:
src/styles/
variables/
_colors.scss ← $color-* brand + semantic tokens
_typography.scss ← $font-*, $text-*, $leading-*
_spacing.scss ← $space-* scale + $radius-*
_effects.scss ← $shadow-*, $duration-*, $ease-*, $z-*
index.scss ← @forward all of the above
tokens/
index.scss ← :root { --var: #{$var}; } — CSS custom properties
base/
_reset.scss
main.scss ← SCSS entry: @use in order
Why: a global variables file eliminates hardcoded values across the codebase, makes theming trivial, and gives you a single source of truth for every color, spacing step, and radius.
Bundler setup (Vite example):
// vite.config.ts — no loadPaths needed when using path aliases
resolve: {
alias: { '@': path.resolve(__dirname, './src') }
}
// Then in any .scss file:
// @use '@/styles/variables' as *;
If the user is in Salesforce / LWC — do not suggest SCSS. Use CSS custom properties (var(--token)) instead.
# Correct
card.scss
user-profile.scss
# Wrong
card.css
user-profile.css
If an existing .css component file is being touched — rename it to .scss and update the import.
In SCSS files use $color-* variables directly.
In plain CSS or when @use is not available, use var(--color-*).
// Wrong — hardcoded
.button { color: #003458; }
// Correct — SCSS variable
@use '@/styles/variables' as *;
.button { color: $color-primary; }
// Also correct — CSS custom property
.button { color: var(--color-primary); }
Never hardcode hex values. If a color is missing from variables — add it there first.
Define a spacing scale in _spacing.scss (4px base step is standard):
$space-1: 0.25rem; // 4px
$space-2: 0.5rem; // 8px
$space-3: 0.75rem; // 12px
$space-4: 1rem; // 16px
$space-6: 1.5rem; // 24px
$space-8: 2rem; // 32px
// etc.
$radius-sm: 0.25rem; // 4px
$radius-md: 0.5rem; // 8px
$radius-lg: 0.75rem; // 12px
$radius-full: 9999px;
Use these variables everywhere. Never write padding: 12px — write padding: $space-3.
One component = one .scss file.
@use '@/styles/variables' as *;
// Optional component-level vars
$avatar-size: 2.5rem;
.card {
background: $color-surface;
border-radius: $radius-lg;
padding: $space-4 $space-6;
&__title { color: $color-text-heading; }
&__body { color: $color-text; }
&--highlighted {
border: 1px solid $color-primary;
}
&:hover { background: $color-surface-hover; }
}
position: absolute unless there is no other wayAbsolute (and fixed) positioning pulls an element OUT of normal flow: it stops contributing to
layout, overlaps siblings, and breaks when content or the container resizes. Reach for it last,
only when flow / flexbox / grid genuinely cannot express the layout.
Prefer, in order:
gap;align-self, margin-*: auto, justify-*);position: absolute ONLY for elements that must truly escape flow — decorative layers behind
content, a badge pinned to a corner, tooltips / popovers / dropdowns, backdrops/overlays.// Wrong — absolute used just to push a button to the corner of a flex row
&__close { position: absolute; top: $space-4; right: $space-4; }
// Right — a trailing flex child; the row's align-items puts it in the corner, still in flow
&__close { align-self: flex-start; margin-left: auto; }
When absolute IS justified, flag it — leave a one-line comment stating why flow can't do it, so a reviewer sees the intent instead of a silent overlay:
// absolute — decorative glow, must overflow the card corner and sit behind content
&__glow { position: absolute; inset-block-start: -3.75rem; ... }
An absolute/fixed with no such justification comment is a review finding — flag it to the user.
.scss (SCSS proposed first if the project had none), a global variables file exists,
and no hardcoded hex or magic number remains — colours from $color-*, spacing from $space-*,
radius from $radius-*, new tokens added to variables/_*.scss first.rem (except border-width, box-shadow offsets, SVG attributes), the structure is BEM
(block -> &__element -> &--modifier), and no position: absolute/fixed stands without a
one-line justification comment.evals/rubric.json.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aquivalabs/bladeforge --plugin frontend-css3 skills in this plugin
/remCSS Units — Always Use remCSS Units — enforce rem for CSS/SCSS/Tailwind dimensions. Use whenever a hardcoded pixel length appears in a stylesheet or component's layout — spacing, sizing, or typography such as gap, padding, margin, width, height, or font-size — and the user wants it changed, reviewed, made consistent with a spacing scale, or made responsive to browser zoom/font-size. Applies whether the value is stated as px, an arbitrary Tailwind value like p-[10px], or an SCSS property. Do NOT trigger for genuinely pixel-appropriate values that stay in px: border-width, box-shadow offsets, or SVG attributes like width, height, and stroke-width on chart/vector elements./responsive-layoutResponsive Layout — Breakpoint ValidityUse when creating or editing ANY UI component, page, or layout style — the acceptance bar that it must render validly at every defined viewport breakpoint (no overflow, readable text, discernible images, restrained borders, sane density). Also use when a project has no breakpoint/grid system yet: propose one before verifying. NOT for choosing px→rem (frontend-css:rem), SCSS tokens/BEM structure (frontend-css:scss-modules), or component folder placement (frontend-react:component-structure).Other plugins' skills for the same job