Removes all DaisyUI references from a Phoenix LiveView project.
Automates DaisyUI cleanup so you can adopt PhiaUI cleanly. Targets configuration files and reports template files that need manual attention.
What gets changed automatically
assets/package.json— removes"daisyui"from dependenciesassets/css/*.css— removes@plugin,@import, and@sourceDaisyUI linesassets/tailwind.config.js— removesrequire("daisyui")anddaisyui:block
What requires manual migration
DaisyUI CSS classes in .heex/.ex template files (e.g., btn-primary,
card-body, modal-box) must be replaced manually. PhiaUI uses function
components — not utility classes — for the same UI primitives:
<%!-- DaisyUI --%>
<button class="btn btn-primary">Save</button>
<%!-- PhiaUI --%>
<.button variant="default">Save</.button>This task scans your templates and reports every file that contains DaisyUI-specific class names so you know exactly what needs updating.
Usage
mix phia.undaisyOptions
--dry-run Show planned changes without modifying any files
--help Print this messageAfter running
Remove the DaisyUI package from your assets directory:
cd assets && npm uninstall daisyui # or: bun remove daisyui / yarn remove daisyui / pnpm remove daisyuiSet up PhiaUI:
mix phia.installMigrate any listed template files from DaisyUI classes to PhiaUI components.
Summary
Functions
Removes DaisyUI @plugin, @import, and @source directives from a CSS string.
Removes the "daisyui" key from a package.json string.
Removes require("daisyui") and the daisyui: config block from a
tailwind.config.js string.
Scans a string for DaisyUI-specific component class names.
Functions
Removes DaisyUI @plugin, @import, and @source directives from a CSS string.
Returns {:changed, new_content} or {:unchanged, original}.
Removes the "daisyui" key from a package.json string.
Handles both "dependencies" and "devDependencies" sections.
Uses Jason when available (standard in Phoenix projects) for clean
round-trip encoding; falls back to regex otherwise.
Returns {:changed, new_content} or {:unchanged, original}.
Removes require("daisyui") and the daisyui: config block from a
tailwind.config.js string.
Returns {:changed, new_content} or {:unchanged, original}.
Scans a string for DaisyUI-specific component class names.
Returns the list of matched class identifiers found in content.