用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill web-styling-scss-modules命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | web-styling-scss-modules |
| description | SCSS Modules, cva, design tokens Use when this capability is needed. |
| metadata | {"author":"agents-inc"} |
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>
Converted and distributed by TomeVault — claim your Tome and manage your conversions.