daisyui-usage

Applies daisyUI 5 component classes and Tailwind CSS utilities to style HTML elements.

Updated Sep 3, 2024
One-click install
npx skills add https://github.com/eminboydak/duckTerm --skill daisyui-usage-eminboydak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: daisyui-usage
Source: https://github.com/eminboydak/duckTerm/tree/main/.agents/skills/daisyui/usage
Command: npx skills add https://github.com/eminboydak/duckTerm --skill daisyui-usage-eminboydak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Styling UI components with daisyUI 5 requires knowing which component, part, and modifier classes to combine, and when to fall back to Tailwind CSS utilities. This Skill provides the authoritative usage rules so generated markup follows daisyUI 5 conventions instead of ad-hoc custom CSS. ## Core Features & Use Cases - Class Selection Rules: Enforces correct use of daisyUI component, part, style, color, size, and modifier classes, with Tailwind utilities as the fallback for gaps. - Specificity and Override Guidance: Shows how to resolve CSS specificity conflicts using the ! suffix on Tailwind utilities and how to restyle components globally with the @utility directive. - Theme and Base Module Control: Covers semantic color tokens, radius utilities like rounded-box, and including or excluding daisyUI base modules such as rootscrollgutter in plugin configuration. - Use Case: When building a Svelte or React page, ask the AI to style a card, button group, or navbar, and it will produce markup using current daisyUI 5 class names with responsive Tailwind prefixes instead of writing custom CSS. ## Quick Start Style this HTML page using daisyUI 5 component classes and Tailwind CSS utilities following the daisyUI usage rules.

Frequently Asked Questions about daisyui-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I style HTML elements with daisyUI 5?

Add the daisyUI component class name to the HTML element, then add applicable part and modifier classes. If daisyUI classes cannot achieve a change, layer Tailwind CSS utility classes on top, such as `btn px-10` for custom padding.

How do I override daisyUI component styles with Tailwind?

When CSS specificity blocks a Tailwind utility from changing a daisyUI style, append `!` to the utility, for example `btn bg-red-500!`. Use this only when other methods fail, and prefer global changes through the `@utility` directive in CSS.

Does daisyUI 5 work with Tailwind CSS utility classes?

Yes, daisyUI 5 is designed to compose with Tailwind utilities. You can use semantic color tokens like `bg-primary` and `text-base-content/60` with opacity modifiers, plus radius utilities like `rounded-box` that follow the active theme.

How do I change a daisyUI component style globally?

Use the Tailwind `@utility` directive in your CSS file, for example `@utility btn { @apply rounded-full; }`. This restyles the component across the entire project without editing individual elements.

Can I exclude daisyUI base modules from the plugin?

Yes, daisyUI includes base modules such as `properties`, `rootcolor`, `scrollbar`, and `rootscrollgutter`. Use the `exclude` or `include` option in the `@plugin "daisyui"` configuration block to control which modules load.

When should I write custom CSS instead of using daisyUI classes?

Avoid custom CSS whenever a daisyUI class or Tailwind utility achieves the result. Write custom CSS only when no applicable component exists and utilities cannot express the style, and prefer building missing components from Tailwind utilities first.