phx-remove-daisyui

Remove DaisyUI from a Phoenix project while keeping Tailwind CSS intact. Use this skill whenever: - The user wants to remove DaisyUI from their Phoenix project - They mention DaisyUI classes not working or wanting to switch to pure Tailwind - They want to build their own custom theme system without DaisyUI dependencies - They're migrating away from DaisyUI components - They see daisyui.js, daisyui-theme.js, or @plugin daisyui references in their codebase This skill systematically removes all DaisyUI dependencies while preserving component structure and logic.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "phx-remove-daisyui" with this command: npx skills add bllyanos/phoenix-skills/bllyanos-phoenix-skills-phx-remove-daisyui

Remove DaisyUI from Phoenix Project

This skill removes DaisyUI from a Phoenix project while keeping Tailwind CSS and preserving all component structure and logic as unstyled examples.

Workflow Overview

  1. Discover DaisyUI usage - Find all vendor files, CSS imports, and CSS class references
  2. Delete vendor files - Remove daisyui.js and daisyui-theme.js from assets/vendor/
  3. Clean app.css - Remove DaisyUI plugin imports and theme definitions
  4. Strip components - Remove DaisyUI classes from core_components.ex, layouts, and templates
  5. Verify - Run mix precommit to ensure everything compiles

Step 1: Discover DaisyUI Usage

Run the discovery script:

elixir phx-remove-daisyui/scripts/discover_daisyui.exs [project_root]

Or manually search for all DaisyUI references:

# Find vendor files
ls assets/vendor/daisyui*.js

# Find CSS imports
grep -r "daisyui" assets/css/

# Find DaisyUI classes in code
grep -r "btn-\|alert-\|toast\|badge\|card \|table-\|checkbox\|select-\|textarea-\|input-\|navbar\|dropdown\|drawer\|modal\|menu\|tabs\|stat\|kbd\|progress\|avatar\|divider\|carousel\|hero \|stack\|steps\|toggle\|fileinput\|mask\|diff\|status\|fieldset\|label \|rounded-box\|bg-base-\|border-base-\|text-base-" lib/

Common DaisyUI classes to remove:

  • Buttons: btn, btn-primary, btn-secondary, btn-ghost, btn-soft, btn-outline, btn-sm, btn-lg
  • Alerts/Flash: alert, alert-info, alert-error, alert-success, alert-warning, toast, toast-top, toast-end
  • Forms: input, input-error, select, select-error, textarea, textarea-error, checkbox, checkbox-sm, fieldset, label, form-control
  • Layout: card, navbar, footer, drawer, modal, dropdown, menu, tabs, tab
  • Data display: table, table-zebra, badge, badge-sm, badge-warning, list, list-row, stat, steps
  • Theme colors: bg-base-100, bg-base-200, bg-base-300, border-base-*, text-base-content*
  • Misc: rounded-box, hero-* (icon classes are OK if using heroicons plugin)

Step 2: Delete Vendor Files

Remove the DaisyUI vendor files:

rm -f assets/vendor/daisyui.js
rm -f assets/vendor/daisyui-theme.js

Step 3: Clean app.css

Edit assets/css/app.css to remove DaisyUI plugin imports and theme definitions.

Remove these sections:

  1. The @plugin "../vendor/daisyui" block
  2. All @plugin "../vendor/daisyui-theme" blocks (there may be multiple for light/dark themes)
  3. Any @custom-variant dark that references [data-theme=...]

Keep:

  • The Tailwind CSS import (@import "tailwindcss" source(none);)
  • The @source directives
  • The Heroicons plugin (if present)
  • LiveView custom variants (phx-click-loading, phx-submit-loading, phx-change-loading)
  • Any custom CSS you want to preserve

Optional: Add a placeholder @layer base block where the user can add their own custom theme variables later.

Step 4: Strip DaisyUI Classes from Components

core_components.ex

For each component function, remove DaisyUI classes while preserving:

  • Component structure and logic
  • Phoenix.LiveView.JS commands
  • Form field handling
  • Error message rendering
  • Slot rendering

Key transformations:

ComponentRemove these classesKeep/Replace with
flash/1toast, toast-top, toast-end, alert, alert-info, alert-error, z-50Keep structure, remove class attrs or use empty strings
button/1btn, btn-primary, btn-soft, btn-ghostKeep custom @class assign logic but return empty list or user-provided classes only
input/1 (all types)fieldset, label, input, input-error, checkbox, checkbox-sm, select, select-error, textarea, textarea-error, text-errorRemove wrapper div classes, remove label classes, keep only user-provided @class
error/1text-sm, text-error, flex, gap-2, items-center, mt-1.5, size-5Remove all styling classes
header/1flex, items-center, justify-between, gap-6, pb-4, text-sm, text-base-content/70, flex-noneKeep structure only
table/1table, table-zebra, hover:cursor-pointer, w-0, font-semibold, flex, gap-4Remove all classes
list/1list, list-row, list-col-grow, font-boldRemove all classes
icon/1Default class size-4Change default to empty string ""

Pattern for editing:

# Before
<div class="fieldset mb-2">
  <label>
    <span :if={@label} class="label mb-1">{@label}</span>
    <input class={[@class || "w-full input", @errors != [] && (@error_class || "input-error")]} />
  </label>
</div>

# After  
<div>
  <label>
    <span :if={@label}>{@label}</span>
    <input class={[@class, @errors != [] && @error_class]} />
  </label>
</div>

layouts.ex

Apply the same pattern to lib/foolish_web/components/layouts.ex:

Common components to update:

  • app/1 - Remove navbar, padding classes, layout classes from header/main wrappers
  • theme_toggle/1 - Remove card, border-base-*, bg-base-*, rounded-full, button styling classes
  • flash_group/1 - Usually just calls flash/1, no changes needed there

Templates (.html.heex files)

Search all HEEx templates and remove DaisyUI classes:

# Find all HEEx files with DaisyUI classes
grep -r "btn-\|alert-\|badge\|card \|table-\|bg-base-\|text-base-" lib/**/*\.html\.heex

Common patterns:

  • Remove badge, badge-warning, badge-sm → keep only non-DaisyUI classes
  • Remove rounded-box, bg-base-200, hover:bg-base-200 → keep structure
  • Remove fill-base-content/40, group-hover:fill-base-content → keep SVG structure
  • Remove text-base-content/70, text-base-content/80 → keep text content

Step 5: Update Theme System (if present)

If the project has a theme toggle system using data-theme attributes:

root.html.heex - The theme toggle JavaScript can stay as-is since it just sets a data-theme attribute. However, without DaisyUI CSS variables, the theme switching won't have any effect until the user builds their own theme system.

You can either:

  1. Leave it - The infrastructure is there for the user to build on
  2. Simplify it - Remove the theme toggle if it's no longer functional
  3. Convert to dark mode - Replace with Tailwind's dark: class system

Default to option 1 (leave it) unless the user specifies otherwise.

Step 6: Verify

Run the precommit checks:

mix precommit

This compiles the project, runs tests, and ensures everything still works.

Output

After completion:

  • ✅ DaisyUI vendor files deleted
  • ✅ DaisyUI CSS plugins removed from app.css
  • ✅ All DaisyUI classes stripped from components
  • ✅ Component structure and logic preserved as unstyled examples
  • ✅ Tailwind CSS still functional
  • ✅ All tests pass

The user now has a clean slate to build their own custom theme system using Tailwind CSS utilities and custom CSS variables.

Notes

  • Heroicons: The hero-* icon classes should remain if the project uses the heroicons Tailwind plugin (check for @plugin "../vendor/heroicons" in app.css)
  • Custom classes: If you see custom classes that aren't DaisyUI (e.g., project-specific utility classes), leave them alone
  • Tailwind utilities: Standard Tailwind classes (flex, grid, px-4, py-2, rounded, shadow, etc.) should remain - only remove DaisyUI-specific component classes
  • CSS variables: DaisyUI uses CSS variables like --color-base-100, var(--color-primary), etc. These won't work after removal but don't need explicit cleanup - they'll just be unused

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Skill Creator (Opencode)

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize a...

Registry SourceRecently Updated
Coding

Funnel Builder

Builds complete multi-channel revenue funnels adapted to any business model. Combines proven frameworks from elite operators: Yomi Denzel's viral top-of-funn...

Registry SourceRecently Updated
Coding

macos-wechat-send

Automates sending messages on WeChat Mac by controlling the app via AppleScript and clipboard to reliably deliver text to specified contacts.

Registry SourceRecently Updated
Coding

Rednote CLI

Use when the user needs to publish, search, inspect, log into, or otherwise operate Xiaohongshu (RedNote) from the terminal with the `@skills-store/rednote`...

Registry SourceRecently Updated