daisyui-usage
Installation
SKILL.md
daisyUI 5 usage rules
- To style an HTML element, add daisyUI class names to it. Add the necessary component class name. Also add the applicable part and modifier class names.
- If the current daisyUI classes cannot make a necessary change, use Tailwind CSS utility classes. For example,
btn px-10sets custom horizontal padding on abtn. - If CSS specificity prevents a change to a daisyUI style, add
!to the end of the Tailwind utility. For example,btn bg-red-500!overrides the background color of abtn. Use this method only if other methods do not work. Do not use it frequently. - If daisyUI does not have an applicable component, make a component with Tailwind CSS utilities.
- When you use Tailwind CSS
flexorgridfor a layout, add responsive utility prefixes. - Use only current daisyUI class names or Tailwind CSS utility classes.
- If custom CSS is not necessary, do not write it. If possible, use daisyUI class names or Tailwind CSS utility classes.
- If you need placeholder images, use https://picsum.photos/200/300 with the necessary dimensions.
- If a custom font is not necessary, do not add one.
- If
bg-base-100 text-base-contentis not necessary, do not add it to the body. - For design decisions, use the methods in the Refactoring UI book.
- If the user does not request a variant or color, use the default variant. For example, use
btnfor a button. If the user does not request that variant, do not usebtn btn-primary.