src/skills/web-styling-scss-modules/SKILL.md
SCSS Modules, cva, design tokens
npx skillsauth add agents-inc/skills web-styling-scss-modulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Quick Guide: Two-tier token system (Core primitives -> Semantic tokens). Foreground/background color pairs. Components use semantic tokens only. SCSS Modules + CSS Cascade Layers. HSL format. Dark mode via
.darkclass with mixin. Data-attributes for state. Self-contained (no external dependencies).
<critical_requirements>
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST wrap ALL UI package component styles in @layer components {} for proper cascade precedence)
(You MUST use semantic tokens ONLY in components - NEVER use core tokens directly)
(You MUST use HSL format for colors with CSS color functions - NO Sass color functions like darken/lighten)
(You MUST use data-attributes for state styling - NOT className toggling)
(You MUST use @use for imports - @import is deprecated and will be removed in Dart Sass 3.0.0)
</critical_requirements>
Auto-detection: UI components, styling patterns, design tokens, SCSS modules, CSS Cascade Layers, dark mode theming
When to use:
Key patterns covered:
.dark class with mixin pattern)When NOT to use:
Detailed Resources:
The design system follows a self-contained, two-tier token architecture where core primitives (raw HSL values, base sizes) map to semantic tokens (purpose-driven names). Components consume only semantic tokens, enabling theme changes without component modifications.
Core Principles:
The design system uses a two-tier token architecture: Tier 1 (Core tokens) provides raw values, Tier 2 (Semantic tokens) references core tokens with purpose-driven names.
Location: packages/ui/src/styles/design-tokens.scss
Tier 1: Core tokens - Raw HSL values, base sizes, primitives
--color-white: 0 0% 100%;
--color-gray-900: 222 47% 11%;
--color-red-500: 0 84% 60%;
--space-unit: 0.2rem;
Tier 2: Semantic tokens - Reference core tokens with purpose-driven names
--color-background-base: var(--color-white);
--color-text-default: var(--color-gray-500);
--color-primary: var(--color-gray-900);
--color-primary-foreground: var(--color-white);
--color-destructive: var(--color-red-500);
Why this matters: Semantic tokens make purpose clear (what the token is for), theme changes only update token values (not component code), components remain theme-agnostic.
For complete implementation examples, see examples/core.md.
Store HSL values without the hsl() wrapper in tokens, apply hsl() wrapper when using tokens, and use modern CSS color functions for transparency and color mixing.
hsl() wrapper: --color-gray-900: 222 47% 11%;hsl() wrapper when applying: background-color: hsl(var(--color-primary))hsl(var(--color-primary) / 0.5) (append alpha to HSL components)color-mix(in srgb, hsl(var(--color-primary)), white 10%)hsl(from hsl(var(--color-primary)) h s calc(l * 0.8)) (wrap origin in hsl() first)darken(), lighten(), transparentize()Why HSL: HSL format eliminates Sass dependencies, CSS color functions work natively in browsers, semantic naming clarifies purpose (not just value), theme changes update token values without touching components.
For complete implementation examples, see examples/core.md.
Use CSS Cascade Layers to control style precedence across the monorepo, ensuring UI package components have lower priority than app-specific overrides.
@layer reset - Browser resets and normalizations@layer components - Design system component styles (UI package)@layer components {}layers.scss first to declare layer orderWhy layers: Wrapping in @layer components {} ensures app styles can override without specificity wars, loading order becomes irrelevant, predictable precedence across monorepo.
For complete implementation examples, see examples/core.md.
.dark Class and MixinImplement dark mode by adding .dark class to root element, which overrides semantic tokens. Use mixin pattern for organization.
.dark class, never Tier 1 core tokensFor complete implementation examples, see examples/theming.md.
The following patterns are documented with full examples in the examples/ folder:
<red_flags>
For complete anti-patterns and red flags, see reference.md.
High Priority Issues:
@layer components {}darken(), lighten())@import instead of @use (deprecated in Dart Sass 1.80.0, removed in 3.0.0)/ for division instead of math.div() (deprecated)</red_flags>
<critical_reminders>
All code must follow project conventions in CLAUDE.md
(You MUST wrap ALL UI package component styles in @layer components {} for proper cascade precedence)
(You MUST use semantic tokens ONLY in components - NEVER use core tokens directly)
(You MUST use HSL format for colors with CSS color functions - NO Sass color functions like darken/lighten)
(You MUST use data-attributes for state styling - NOT className toggling)
(You MUST use @use for imports - @import is deprecated and will be removed in Dart Sass 3.0.0)
Failure to follow these rules will break theming, create cascade precedence issues, and violate design system conventions.
</critical_reminders>
development
Material Design component library for Vue 3
development
VitePress 1.x — Vue-powered static site generator for documentation sites, built on Vite
tools
Docusaurus 3.x documentation framework — site configuration, docs/blog plugins, sidebars, versioning, MDX, swizzling, and deployment
development
TanStack Form patterns - useForm, form.Field, validators, arrays, linked fields, createFormHook, type safety