Agent skill
styling
CSS and Tailwind styling guidelines for this codebase. Use when the user says "style this", "fix the CSS", "add classes", or when writing Tailwind utilities, using cn(), creating UI components, reviewing CSS code, or deciding on wrapper element structure.
Install this agent skill to your Project
npx add-skill https://github.com/EpicenterHQ/epicenter/tree/main/.agents/skills/styling
Metadata
Additional technical details for this skill
- author
- epicenter
- version
- 1.0
SKILL.md
Styling Guidelines
Reference Repositories
- shadcn-svelte — Port of shadcn/ui for Svelte with Bits UI primitives
- shadcn-svelte-extras — Additional components for shadcn-svelte
- Svelte — Svelte 5 framework
When to Apply This Skill
Use this pattern when you need to:
- Write Tailwind/CSS for UI components in this repo.
- Decide whether a wrapper element is necessary or can be removed.
- Style interactive disabled states using HTML
disabledand Tailwind variants. - Replace JS click guards with semantic disabled behavior.
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/utilsfor combining classes conditionally - Prefer utility classes over custom CSS
- Use
tailwind-variantsfor component variant systems - Follow the
background/foregroundconvention for colors - Leverage CSS variables for theme consistency
Disabled States: Use HTML disabled + Tailwind Variants
When an interactive element can be non-interactive (empty section, loading state, no items), use the HTML disabled attribute instead of JS conditional guards. Pair it with Tailwind's enabled: and group-disabled: variants.
Why disabled Over JS Guards
disablednatively blocks clicks—noif (!hasItems) returnneeded- Enables the
:disabledCSS pseudo-class for styling - Semantically correct for accessibility (screen readers announce "dimmed" or "unavailable")
- Tailwind's
enabled:andgroup-disabled:variants compose cleanly
Pattern
<!-- The button disables itself when count is 0 -->
<button
class="group enabled:cursor-pointer enabled:hover:opacity-80"
disabled={item.count === 0}
onclick={toggle}
>
{item.label} ({item.count})
<ChevronIcon class="group-disabled:invisible" />
</button>
Key Variants
enabled:cursor-pointer— pointer cursor only when clickableenabled:hover:bg-accent/50— hover effects only when interactivegroup-disabled:invisible— hide child elements (e.g., expand chevron) when parent is disableddisabled:opacity-50— dim the element when disabled
Anti-Pattern
<!-- Don't do this: JS guard duplicates what disabled does natively -->
<button
class="cursor-pointer hover:opacity-80"
onclick={() => { if (item.count > 0) toggle(); }}
>
The JS guard leaves cursor-pointer and hover:opacity-80 active on a non-interactive element. The user sees a clickable button that does nothing. Use disabled and let the browser + CSS handle it.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
svelte
Svelte 5 patterns including runes ($state, $derived, $props), TanStack Query, SvelteMap reactive state, shadcn-svelte components, and component composition. Use when the user mentions .svelte files, Svelte components, or when using TanStack Query, fromTable/fromKv, or shadcn-svelte UI.
autumn
Integrate Autumn billing—define features/plans in autumn.config.ts, use autumn-js SDK for credit checks/tracking, manage the atmn CLI for push/pull. Use when working on billing, pricing, credits, plan gating, or metered usage.
handoff-prompt
Draft a self-contained implementation prompt that an agent can execute with zero prior context. Use when the user says "draft a prompt", "write a handoff", "make a prompt I can copy-paste", "create a delegation brief", or wants to hand off a task to another agent, tool, or conversation.
typebox
TypeBox and TypeMap patterns for runtime schema validation and JSON Schema generation. Use when the user mentions TypeBox, TypeMap, Standard Schema, or when working with runtime type validation, JSON Schema, or schema-based validation.
factory-function-composition
Apply factory function patterns to compose clients and services with proper separation of concerns. Use when creating functions that depend on external clients, wrapping resources with domain-specific methods, or refactoring code that mixes client/service/method options together.
progress-summary
This skill should be used when the user asks questions like "can you summarize", "what happened", "what did we do", "what's the situation", "where are we at", "explain what's going on", "give me an overview", "what's been done", "tell me about this", "walk me through what happened", or any question asking to understand the current state of work or changes. Provides conversational, PR-style summaries with visual diagrams.
Didn't find tool you were looking for?