Elixir
  • My Elixir journey
  • Why functional programming?
  • Exhort
    • 🗓️Day 22
    • 🗓️Day 21
    • 🗓️Day 20
    • 🗓️Day 19
    • 🗓️Day 18
    • 🗓️Day 17
    • 🗓️Day 16
    • 🗓️Day 15
    • 🗓️Day 14
  • Bits and pieces
    • Clean mix dependencies
    • Run tests automatically on save
    • Run tests and stop on first failure
    • How to remove Tailwind from a Phoenix project
Powered by GitBook
On this page
  1. Bits and pieces

How to remove Tailwind from a Phoenix project

PreviousRun tests and stop on first failure

Last updated 6 months ago

There's a chance you have an existing Phoenix project that has been created with the default option of having TailwindCSS integrated, but you would like to go vanilla CSS.

Steps

  1. Remove :tailwind from mix.exs

  2. Remove related commands from aliases in mix.exs (make sure to preserve any esbuild builds if you are using that).

  3. Remove @import "tailwindcss/... from app.css

  4. Open js/app.js and add import "../css/app.css" to it.

  5. Delete file /assets/tailwind.config.js

  6. Remove block starting with config :tailwind from config.exs

  7. Remove tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]} from watchers inside dev.exs

  8. Run mix deps.clean --unlock --unused

You may have to fix layout related issues, how you render flash messages, and adjust core_components.exs.

Original solution found in .

Elixir Forums