styling-patterns

DaisyUI v5 design system. Use for backgrounds, borders, text sizes, opacity, semantic colors, and spacing.

⭐6stars🔀0forks📁View on GitHub🕐Updated Jan 1, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill integrates the DaisyUI v5 design system to provide a structured approach to web styling and UI development. It solves the problem of visual inconsistency and 'CSS bloat' by enforcing strict patterns for background layering, typography hierarchies, and semantic color usage. By utilizing these predefined patterns, the agent can generate high-quality, accessible, and theme-responsive HTML/Tailwind code that adheres to professional design principles out of the box.

Use Cases

  • Creating Hierarchical Layouts: Automatically applying correct background nesting (e.g., base-100 for cards on a base-200 page) to ensure proper visual depth and separation.
  • Standardizing Typography: Implementing a consistent font-size scale from 3xl to xs to maintain clear information architecture across headers and body text.
  • Theme-Ready Styling: Using semantic colors and specific opacity rules (60/70/80) to ensure the UI remains accessible and visually appealing in both light and dark modes.
  • Component Refinement: Applying standardized shadow depths and border styles (border-base-300) to create a unified and professional look across all interactive elements.
namestyling-patterns
descriptionDaisyUI v5 design system. Use for backgrounds, borders, text sizes, opacity, semantic colors, and spacing.

Styling Patterns

Quick Start

<!-- ✅ Correct: Proper background hierarchy -->
<div class="bg-base-200 p-6">
	<div class="card bg-base-100 p-4 shadow-md">
		<h2 class="mb-3 text-2xl font-bold">Section Title</h2>
		<p class="text-base">Main content text</p>
		<p class="text-sm opacity-60">Secondary metadata</p>
	</div>
</div>

<!-- ❌ Wrong: Same background as parent -->
<div class="bg-base-100">
	<div class="card bg-base-100">No visual separation</div>
</div>

Core Principles

  • Background hierarchy: base-200 (page) → base-100 (card) → base-200 (nested) - never same as parent
  • Borders: Use border-base-300 solid (no opacity)
  • Text sizes: 3xl (h1) → 2xl (h2) → xl (h3) → base (body) → sm (metadata) → xs (hints)
  • Opacity: ONLY 60/70/80, ONLY on metadata/descriptions (never titles/buttons/primary actions)
  • Shadows: md (default) → lg (hover) → xl (important)
  • Semantic colors: error/success should NOT have opacity
  • Test contrast: Always verify on both light and dark themes

Reference Files