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/local-tools 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
open understand dashboard for user
tools
这是一个技能文件的模板,展示了技能的基本结构和内容组织方式。
development
Be direct and informative. No filler, no fluff, but give enough to be useful.
development
使用 Evaluator-optimizer 模式进行系统性多轮网络搜索,采用结构化 Ask 流程在搜索前澄清研究目标。基于 YC Office Hours 的提问方法论,确保搜索方向清晰、结果可验证。当用户需要深入调查复杂主题、验证假设或全面收集信息时使用。