Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/mikailustuner/OmniRule --skill css-variables명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | css-variables |
| description | Custom properties, theming, runtime changes |
| triggers | {"extensions":[".css",".scss"],"keywords":["--var","custom properties","CSS variables","design tokens","theme","var("]} |
| auto_load_when | Working with CSS custom properties or design tokens |
| agent | style-architect |
| tools | ["Read","Write","Bash"] |
Focus: Custom properties, theming, runtime changes
When to use custom properties:
├── Theming → yes
├── Responsive values → yes
├── Runtime changes → yes
├── Shared values → yes
When to use for:
├── Colors → yes
├── Spacing → yes
├── Typography → yes
├── Animations → yes
└── Breakpoints → yes (with calc)
When to avoid:
├── Static values → hardcode
├── Once-only → hardcode
├── Performance-critical → hardcode
└── Complex calculation → precalculate
When to use CSS variables:
├── Runtime theming → yes
├── Multiple themes → yes
├── User preference → yes
└── No framework → yes
When to use framework theming:
├── Design system → yes
├── Dark mode built-in → yes
├── Theme provider → yes
└── CSS-only theme → CSS variables
When to structure:
├── By category → colors/typography/spacing
├── By component → component-scoped
├── Global then scoped → yes
└── Flat → avoid for scaling
When to use global:
├── Shared values → yes
├── Defaults → yes
├── Token values → yes
└── Cross-component → yes
When to use scoped:
├── Component-specific → yes
├── Override global → yes
├── Shadow DOM → required
└── Isolation → yes
When to use --css-var-prefix:
├── Design system → yes
├── Third-party conflict → yes
├── All same prefix → consistent
└── No conflict → optional
When to change via JS:
├── User interaction → yes
├── Theme toggle → yes
├── Device preference → yes
└── Feature detection → yes
When to change via CSS:
├── Media queries → yes
├── Hover/focus → yes
├── Container queries → yes
└── @supports → yes
When to use prefers-color-scheme:
├── System dark mode → yes
├── User preference → yes
├── Fallback → yes
└── Manual toggle → also provide
When to add fallback:
├── Old browser → yes
└── Unknown support → yes
Fallback syntax:
color: var(--primary, #0066cc);
padding: var(--spacing-md, 1rem);
When to use:
├── Primitive value → yes
├── Complex value → pre-define
└── Last resort → always provide
When NOT to use:
├── Always supported → no fallback needed
├── Required value → no fallback hides
└── Empty var → use differently
When to use calc():
├── Responsive sizing → yes
├── Combining variables → yes
└── Mixed units → yes
When to use clamp():
├── Fluid sizing → yes
├── Min/max bound → yes
└── Range control → yes
When to use min()/max():
├── Responsive bounds → yes
├── Fluid typography → yes
└── Container queries → yes
When to precalculate:
├── Many calculations → slow
├── Same result → pre-calc
└── Print/offline → pre-calc
❌ Defining CSS variables inside component selectors (scope too narrow)
✅ Define tokens at :root; override per component/theme
❌ Variable names that describe appearance (--blue-500)
✅ Semantic names: --color-primary, --color-text-muted
❌ Duplicating values instead of referencing variables
✅ Reference variables everywhere — single source of truth
❌ JavaScript setting CSS variables on every frame
✅ Use CSS calc() and CSS math instead; JS for initial set only
❌ No fallback for browsers that don't support var()
✅ var(--value, fallback) — always provide fallback
| Task | Syntax | Example |
|---|---|---|
| Define token | :root { --name: value } | --spacing-4: 1rem |
| Use token | var(--name) | padding: var(--spacing-4) |
| Fallback | var(--name, fallback) | color: var(--text, #000) |
| Dark theme | [data-theme="dark"] { } | Override tokens |
| JS read | getPropertyValue | getComputedStyle(el) |
| JS set | setProperty | el.style.setProperty |