Skip to content

tailwind config #190

@CatalinPlesu

Description

@CatalinPlesu

Environment

  • Erlang: 27.3.4.2
  • Elixir: 1.18.4
  • Phoenix: {:phoenix, "~> 1.8.1"}

Problem

The Tailwind CSS and DaisyUI styles are not applied in the new project.
I tought that simply copying the tailwind.config.js from example_project/assets/tailwind.config.js into my assets folder would solve the probelm but it appears that tailwind isn't configured to use a config in a new project.


Fix: Configure Tailwind

The solution requires two steps: copying the configuration and updating the Phoenix build arguments.

  1. Copy the example configuration file example_project/assets/tailwind.config.js into your project's assets/ directory.

  2. Update the build arguments in your main configuration file config/config.exs for the :tailwind package to explicitly include the config file:

    # In config/config.exs
    
    config :tailwind,
      args: [
        "--config=tailwind.config.js",
        # ... 
      ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions