金色时刻 · 15:48
让好资源,触手可及
AGENT SKILL

styling

styling 是面向软件开发的 Agent Skill,来自 EpicenterHQ/epicenter。查看技能说明、操作步骤与使用约定,并通过原项目了解详细用法。

CSS and Tailwind styling guidelines. Use when writing styles, creating UI components, reviewing CSS/Tailwind code, or deciding on wrapper element structure.

SKILL.md

下载 MD ↓
namestyling
descriptionCSS and Tailwind styling guidelines. Use when writing styles, creating UI components, reviewing CSS/Tailwind code, or deciding on wrapper element structure.

Styling Guidelines

Minimize Wrapper Elements

Avoid creating unnecessary wrapper divs. If classes can be applied directly to an existing semantic element with the same outcome, prefer that approach.

Good (Direct Application)

<main class="flex-1 mx-auto max-w-7xl">
    {@render children()}
</main>

Avoid (Unnecessary Wrapper)

<main class="flex-1">
    <div class="mx-auto max-w-7xl">
        {@render children()}
    </div>
</main>

This principle applies to all elements where the styling doesn't conflict with the element's semantic purpose or create layout issues.

Tailwind Best Practices

  • Use the cn() utility from $lib/utils for combining classes conditionally
  • Prefer utility classes over custom CSS
  • Use tailwind-variants for component variant systems
  • Follow the background/foreground convention for colors
  • Leverage CSS variables for theme consistency

来源:EpicenterHQ/epicenter · MIT 许可 · 许可原文 · MD 为来源页保存的历史版本