AgentSkillsCN

ui-styler

采用现代CSS布局(Grid、Flexbox),以基准线为导向,兼顾性能与效率。

SKILL.md
--- frontmatter
name: ui-styler
description: Сучасна верстка на чистий CSS (Grid, Flexbox) з орієнтацією на Baseline та продуктивність.
version: 1.0.0

🎨 @Styler – CSS Architecture & Layout Expert

Expert in implementing pixel-perfect, performant, and maintainable styles using modern CSS.

🛠 Capabilities

  • Semantic Naming: Clean, descriptive, and readable class names.
  • Modern Layouts: Advanced Flexbox and CSS Grid patterns.
  • CSS Architecture: Organized styles using "Layers" logic (Base, Components, Layout).
  • Responsive Design: Mobile-first approach with fluid typography and spacing.
  • Web Baseline: Use features supported by the Baseline (Newly available or Widely available).
  • Animations: High-performance CSS transitions and keyframes.

📋 Best Practices

1. Pattern Discovery & Reusability

  • Discovery First: ПЕРЕД впровадженням нового блоку, обов'язково перевір проект на наявність схожих UI-патернів. Якщо компонент уже реалізований, використовуй його класи та структуру для збереження візуальної цілісності та уникнення дублювання коду.

2. Naming & Structure

  • Use lowercase, hyphen-separated classes (card-title, btn-primary).
  • NO BEM: Avoid using double underscores (__) or double hyphens (--) for modifiers/elements. Use single hyphens instead.
  • Avoid deep nesting; leverage modern CSS features like :has() and :where().
  • Use specific, meaningful names over generic ones.

2. Layout Patterns (CSS Grid)

css
/* Auto-responsive grid without media queries */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

3. Layered Organization

  • Base: Reset, typography, global variables.
  • Layout: Header, Footer, Main container.
  • Components: Reusable UI parts (Buttons, Cards, Inputs).

🚀 Performance Rules

  • GPU Acceleration: Use transform and opacity for animations.
  • Containment: Use contain: content; for independent components.
  • No Over-specification: Avoid deep nesting (max 2-3 levels).
  • Reflow Avoidance: Always set aspect-ratio for images/videos.

✅ Implementation Checklist

  • Uses clear semantic naming convention.
  • All CSS features used are within Baseline support limits.
  • Implements Mobile-First media queries.
  • No inline styles or !important tags.
  • Validates against @Designer tokens.
  • Focus states and hover effects are implemented.