Agent SkillsRightNow-AI/openfang › css-expert

css-expert

GitHub

CSS布局专家技能,提供Flexbox、Grid、动画及响应式设计等现代CSS技术的精准指导,涵盖关键原则、常用模式与避坑指南,旨在构建标准合规、可维护的UI。

crates/openfang-skills/bundled/css-expert/SKILL.md RightNow-AI/openfang

Trigger Scenarios

需要实现复杂页面布局 解决响应式适配问题 优化CSS性能与动画 设计CSS变量与主题

Install

npx skills add RightNow-AI/openfang --skill css-expert -g -y
More Options

Non-standard path

npx skills add https://github.com/RightNow-AI/openfang/tree/main/crates/openfang-skills/bundled/css-expert -g -y

Use without installing

npx skills use RightNow-AI/openfang@css-expert

指定 Agent (Claude Code)

npx skills add RightNow-AI/openfang --skill css-expert -a claude-code -g -y

安装 repo 全部 skill

npx skills add RightNow-AI/openfang --all -g -y

预览 repo 内 skill

npx skills add RightNow-AI/openfang --list

SKILL.md

Frontmatter
{
    "name": "css-expert",
    "description": "CSS expert for flexbox, grid, animations, responsive design, and modern layout techniques"
}

CSS Expert

A front-end layout specialist with deep command of modern CSS, from flexbox and grid to container queries and cascade layers. This skill provides precise, standards-compliant guidance for building responsive, accessible, and maintainable user interfaces using the latest CSS specifications and best practices.

Key Principles

  • Use flexbox for one-dimensional layouts (rows or columns) and CSS Grid for two-dimensional layouts (rows and columns simultaneously)
  • Embrace custom properties (CSS variables) for theming, spacing scales, and any value that repeats or needs runtime adjustment
  • Design mobile-first with min-width media queries, layering complexity as viewport size increases
  • Prefer logical properties (inline-start, block-end) over physical ones (left, bottom) for internationalization-ready layouts
  • Leverage the cascade intentionally with @layer declarations to control specificity without resorting to !important

Techniques

  • Use flexbox justify-content and align-items for main-axis and cross-axis alignment; flex-wrap with gap for fluid card layouts
  • Define CSS Grid layouts with grid-template-areas for named regions, and auto-fit/auto-fill with minmax() for responsive grids without media queries
  • Create design tokens as custom properties on :root (--color-primary, --space-md) and override them in scoped selectors or media queries
  • Use @container queries to style components based on their parent container size rather than the viewport
  • Build animations with @keyframes and animation shorthand; prefer transform and opacity for GPU-accelerated, jank-free motion
  • Apply transitions on interactive states (hover, focus-visible) with appropriate duration (150-300ms) and easing functions
  • Use the :has() selector for parent-aware styling, :is()/:where() for grouping selectors with controlled specificity

Common Patterns

  • Holy Grail Layout: CSS Grid with grid-template-rows (auto 1fr auto) and grid-template-columns (sidebar content sidebar) for header/footer/sidebar page structures
  • Fluid Typography: clamp(1rem, 2.5vw, 2rem) for font sizes that scale smoothly between minimum and maximum values without breakpoints
  • Aspect Ratio Boxes: Use the aspect-ratio property directly instead of the legacy padding-bottom hack for responsive media containers
  • Dark Mode Toggle: Define color tokens as custom properties, swap them inside a prefers-color-scheme media query or a data-theme attribute selector

Pitfalls to Avoid

  • Do not use fixed pixel widths for layout containers; prefer percentage, fr units, or min/max constraints for fluid responsiveness
  • Do not stack z-index values arbitrarily; establish a z-index scale in custom properties and document each layer's purpose
  • Do not rely on vendor prefixes without checking current browser support; tools like autoprefixer handle this systematically
  • Do not nest selectors excessively in preprocessors, as the generated CSS becomes highly specific and difficult to maintain or override

Version History

  • acf2587 Current 2026-08-20 07:38

Same Skill Collection

crates/openfang-hands/bundled/browser/SKILL.md
crates/openfang-hands/bundled/clip/SKILL.md
crates/openfang-hands/bundled/collector/SKILL.md
crates/openfang-hands/bundled/infisical-sync/SKILL.md
crates/openfang-hands/bundled/lead/SKILL.md
crates/openfang-hands/bundled/predictor/SKILL.md
crates/openfang-hands/bundled/researcher/SKILL.md
crates/openfang-hands/bundled/trader/SKILL.md
crates/openfang-hands/bundled/twitter/SKILL.md
crates/openfang-skills/bundled/ansible/SKILL.md
crates/openfang-skills/bundled/api-tester/SKILL.md
crates/openfang-skills/bundled/aws/SKILL.md
crates/openfang-skills/bundled/azure/SKILL.md
crates/openfang-skills/bundled/ci-cd/SKILL.md
crates/openfang-skills/bundled/code-reviewer/SKILL.md
crates/openfang-skills/bundled/compliance/SKILL.md
crates/openfang-skills/bundled/confluence/SKILL.md
crates/openfang-skills/bundled/crypto-expert/SKILL.md
crates/openfang-skills/bundled/data-analyst/SKILL.md
crates/openfang-skills/bundled/data-pipeline/SKILL.md
crates/openfang-skills/bundled/docker/SKILL.md
crates/openfang-skills/bundled/elasticsearch/SKILL.md
crates/openfang-skills/bundled/email-writer/SKILL.md
crates/openfang-skills/bundled/figma-expert/SKILL.md
crates/openfang-skills/bundled/gcp/SKILL.md
crates/openfang-skills/bundled/git-expert/SKILL.md
crates/openfang-skills/bundled/github/SKILL.md
crates/openfang-skills/bundled/golang-expert/SKILL.md
crates/openfang-skills/bundled/graphql-expert/SKILL.md
crates/openfang-skills/bundled/helm/SKILL.md
crates/openfang-skills/bundled/interview-prep/SKILL.md
crates/openfang-skills/bundled/jira/SKILL.md
crates/openfang-skills/bundled/kubernetes/SKILL.md
crates/openfang-skills/bundled/linear-tools/SKILL.md
crates/openfang-skills/bundled/linux-networking/SKILL.md
crates/openfang-skills/bundled/llm-finetuning/SKILL.md
crates/openfang-skills/bundled/ml-engineer/SKILL.md
crates/openfang-skills/bundled/mongodb/SKILL.md
crates/openfang-skills/bundled/nextjs-expert/SKILL.md
crates/openfang-skills/bundled/nginx/SKILL.md
crates/openfang-skills/bundled/notion/SKILL.md
crates/openfang-skills/bundled/oauth-expert/SKILL.md
crates/openfang-skills/bundled/openapi-expert/SKILL.md
crates/openfang-skills/bundled/postgres-expert/SKILL.md
crates/openfang-skills/bundled/presentation/SKILL.md
crates/openfang-skills/bundled/project-manager/SKILL.md
crates/openfang-skills/bundled/prometheus/SKILL.md
crates/openfang-skills/bundled/prompt-engineer/SKILL.md
crates/openfang-skills/bundled/python-expert/SKILL.md

Metadata

Files
0
Version
acf2587
Hash
ca02c989
Indexed
2026-08-20 07:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 06:19
浙ICP备14020137号-1 $mapa de visitantes$