frontend-css-strategy
Use when the user asks which styling approach to use: CSS Modules vs CSS-in-JS vs Tailwind, styled-components, Emotion, vanilla-extract, BEM, Sass, PostCSS…
от j4flmao★ 47 звёзд на GitHub
Установить frontend-css-strategy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Frontend CSS Strategy
Purpose
Choose and implement the right CSS approach for the project. Utility-first for rapid iteration and consistency. CSS Modules for scoped, component-encapsulated styles. CSS-in-JS for dynamic theming and colocation. Each approach solves a different problem — pick the right one.
Agent Protocol
Trigger
Exact phrases: "CSS strategy", "CSS Modules", "CSS-in-JS", "utility-first", "Tailwind CSS", "styled-components", "Emotion", "CSS organization", "CSS architecture", "CSS approach", "styling approach", "how to style", "CSS decision".
Input Context
- Framework (React, Vue, Angular, Svelte)
- Team size and CSS experience
- Project type (library, app, design system)
- Current styling approach (if any)
- Performance requirements (runtime cost, bundle size)
Output Artifact
CSS strategy recommendation with rationale, setup code, and organization pattern.
Response Format
## Recommendation
<approach> — <rationale>
## Setup
<config, dependencies, file-structure>
## Usage
<component-example, naming-convention>
## Organization
<folder-structure, globals, utilities>
—
Compression footer: frontend-css/v1 | approach: <tailwind|modules|css-in-js> | perf: <runtime|zero>
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.
Completion Criteria
- CSS approach selected with documented rationale
- File and folder structure created
- Global styles (reset, variables, typography) configured
- Component styling pattern established with examples
- Responsive and state-based styling pattern defined
- Build tool configured for chosen approach
Max Response Length
4096 tokens
Workflow
1. Approach Decision
Project type?
├── Design system / component library -> CSS Modules or vanilla-extract (zero runtime, scoped)
├── Large app with many developers -> Tailwind CSS (consistent, low decision fatigue)
├── Highly themed / white-label app -> CSS-in-JS or CSS variables (dynamic theming)
├── Micro-frontend -> CSS Modules (isolation)
└── Small app / prototype -> Any — pick based on team preference
2. Approach Comparison
| Approach | Runtime | Scoping | Dynamic Themes | Bundle Size | Learning Curve |
|---|---|---|---|---|---|
| Utility-first (Tailwind) | Zero | N/A (utility classes) | Via CSS vars | Small (purged) | Low-Medium |
| CSS Modules | Zero | Automatic (hash) | Via CSS vars | Zero runtime | Low |
| styled-components | Runtime | Automatic (hash) | Native | ~12KB runtime | Medium |
| Emotion | Runtime | Automatic (hash) | Native | ~8KB runtime | Medium |
| vanilla-extract | Zero | Automatic (hash) | Via CSS vars | Zero runtime | Medium |
| Linaria | Zero | Automatic (hash) | Via CSS vars | Zero runtime | Medium |
| Stitches | Runtime | Automatic | Native | ~5KB runtime | Medium |
| Raw CSS/Sass | Zero | Manual (BEM) | Via CSS vars | Zero | Low |
3. File Organization
src/
styles/
reset.css /* CSS reset */
variables.css /* CSS custom properties */
typography.css /* Font faces, text styles */
utilities.css /* Utility classes (if not Tailwind) */
animations.css /* Keyframes */
components/
Button/
Button.tsx
Button.module.css
Button.test.tsx
Card/
Card.tsx
Card.module.css
Card.test.tsx
pages/
Home/
Home.tsx
Home.module.css
4. CSS Modules Pattern
/* Button.module.css */
.root {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-radius: 6px;
font-weight: 500;
}
.primary {
background: var(--color-primary);
color: white;
}
.secondary {
background: transparent;
border: 1px solid var(--color-border);
}
5. Tailwind Pattern
export function Button({ variant = 'primary', ...props }: ButtonProps) {
const variants = {
primary: 'bg-blue-600 text-white hover:bg-blue-700',
secondary: 'bg-transparent border border-gray-300 hover:bg-gray-50',
}
return (
<button
className={`inline-flex items-center gap-2 px-4 py-2 rounded-md font-medium transition-colors ${variants[variant]}`}
{...props}
/>
)
}
6. Styled Components Pattern
import styled, { css } from 'styled-components'
interface ButtonProps {
$variant: 'primary' | 'secondary'
$large?: boolean
}
export const StyledButton = styled.button<ButtonProps>`
display: inline-flex;
align-items: center;
gap: 8px;
padding: ${({ $large }) => ($large ? '12px 24px' : '8px 16px')};
border-radius: 6px;
font-weight: 500;
cursor: pointer;
${({ $variant }) =>
$variant === 'primary'
? css`
background: var(--color-primary);
color: white;
`
: css`
background: transparent;
border: 1px solid var(--color-border)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/container-queries.md
- references/css-approaches.md
- references/css-architecture-methodologies.md
- references/css-custom-properties.md
- references/css-methodology.md
- references/css-organization.md
- references/css-performance-bundle-optimization.md
- references/css-performance.md
FAQ
Что делает скилл frontend-css-strategy?
Use when the user asks which styling approach to use: CSS Modules vs CSS-in-JS vs Tailwind, styled-components, Emotion, vanilla-extract, BEM, Sass, PostCSS, cascade layers or CSS architecture. Produces a styling decision with folder and naming conventions. Not for Tailwind configuration (use frontend-tailwind-css) or dark mode (use frontend-theming).
Как установить скилл frontend-css-strategy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frontend-css-strategy запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…