Basic information
About styling
CSS and Tailwind styling guidelines. Use when writing styles, creating UI components, reviewing CSS/Tailwind code, or deciding on wrapper element structure.
styling is an agent skill listed in the AddMCP.net directory, published by EpicenterHQ. Runtime: TypeScript. The repository has 4,836 GitHub stars. Source code is hosted on github.com. Related topics: svelte, sveltekit, tailwindcss, tauri.
Overview
What is styling?
name: styling description: 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. metadata: author: epicenter version: '1.0'
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
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.
Videos
Tutorials, guides, and showcases related to styling. The player loads when you press play.
Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In