local-link/skills/css-dev-skills/skills/css-expert/SKILL.md
Expert CSS guidance for writing modern, performant, accessible CSS. Use when writing CSS, styling components, creating layouts, building themes, fixing visual bugs, or refactoring stylesheets. Activates automatically for any CSS-related task. Covers cascade layers, custom properties, container queries, modern selectors, nesting, logical properties, and animation performance.
npx skillsauth add lionad-morotar/simple-local-llm-server css-expertInstall 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.
You are a senior CSS engineer. When writing or reviewing CSS, follow these principles and patterns. For the full pattern catalog, see modern-patterns.md. For anti-patterns to avoid, see anti-patterns.md. For browser compatibility guidance, see browser-compat.md.
oklch() over hsl().@layer to organize styles. Understand specificity — don't fight it with !important. Use :where() to zero-out specificity when needed.transform and opacity for composited animations. Use contain and content-visibility where appropriate. Avoid layout thrashing.prefers-reduced-motion. Provide :focus-visible styles. Support forced-colors mode. Maintain contrast ratios.inline-start, block-end) over physical (left, bottom)oklch() or oklab() for perceptually uniform colorsclamp() for fluid typography and spacing@layer to organize reset, tokens, layout, components, utilities:where() to keep specificity flat in reusable codelight-dark() for theme-aware color valuesfloat for layout!important (unless overriding third-party styles with no alternative)rem or clamp()#id selectors for styling — specificity is too high@import in stylesheets (use @layer or <link> instead)px for media queries — use emwidth, height, top, left, margin, or padding.container, .wrapper, .content without scopingNeed a layout?
├── 2D grid (rows AND columns) → CSS Grid
│ ├── Alignment across tracks → subgrid
│ └── Component-level responsiveness → container queries
├── 1D alignment (row OR column) → Flexbox
│ ├── Wrapping items → flex-wrap + gap
│ └── Centering → place-items: center (grid) or margin: auto (flex)
└── Overlapping/stacking → Grid with grid-area or position: absolute
/* Layer 1: Global design tokens */
:root {
--color-primary: oklch(65% 0.25 250);
--space-m: clamp(1rem, 1rem + 1vw, 1.5rem);
--text-base: clamp(1rem, 0.875rem + 0.5vw, 1.125rem);
}
/* Layer 2: Semantic aliases */
:root {
--color-surface: light-dark(oklch(98% 0 0), oklch(15% 0 0));
--color-text: light-dark(oklch(20% 0 0), oklch(90% 0 0));
}
/* Layer 3: Component-scoped tokens */
.button {
--_bg: var(--color-primary);
--_text: white;
background: var(--_bg);
color: var(--_text);
}
@layer reset, tokens, base, layout, components, utilities;
Lower layers have lower priority. Utilities always win. Un-layered styles beat all layers.
Prefer container queries for component-level responsiveness and media queries only for page-level layout shifts:
.card-grid {
container-type: inline-size;
.card {
@container (inline-size < 400px) {
flex-direction: column;
}
}
}
Use clamp() for fluid values that don't need breakpoints:
h1 { font-size: clamp(1.5rem, 1rem + 2vw, 3rem); }
transform and opacity for 60fpswill-change sparingly and only on elements about to animate@media (prefers-reduced-motion: reduce) to disable non-essential motion@keyframes for complex sequencesanimation-timeline: scroll() for scroll-driven effects:focus-visible on all interactive elements — never outline: noneprefers-reduced-motion: reduce → disable animations, use transition-duration: 0.01msprefers-contrast: more → increase borders, darken textforced-colors: active → test in Windows High Contrast modeFor deeper work in specific areas, use these slash commands:
/css-audit — comprehensive CSS quality audit/css-layout — modern layout solutions/css-animate — performant animations/css-responsive — responsive design/css-refactor — upgrade legacy CSS/css-theme — theming systems/css-a11y — accessibility/css-debug — debuggingtools
理解用户意图;listen 模式通过 grill-me 深挖任务并归档经验
development
给 VSCode(Insiders/Stable) 内置 ripgrep 加 5s 超时包装,防止搜索卡死吃满 CPU。--on 包装(幂等) / --off 还原 / 不带参数查状态。Use when VSCode 搜索卡死、rg 进程占满 CPU,或 VSCode 更新后超时保护失效需要重包。
development
为指定项目创建完全隔离的 hapi(Claude Code On the Go)实例,包括独立数据目录、LaunchAgent 持久化、zsh wrapper 和 app.hapi.run 直连 URL。与全局 ~/.hapi 互不干扰。
development
关闭承载当前 Claude Code 会话的宿主(VSCode 窗口或其终端面板),连同 claude 一起退出。通过 close-host-window 扩展触发:先 SIGTERM claude(走完 SessionEnd hooks)再关 host,不抢焦点、不丢 hooks。--host vscode 关窗口、--host terminal(默认)只关终端面板。Use when 任务结束要随宿主退出,或需精确关闭某 claude 终端所在窗口/面板。