virinchi_cv
Option to pass a --no-daisy flag when creating a new phoenix project
The Problem
Phoenix 1.8 comes aggressively coupled with Daisy UI, a decision which many developers in the community have had mixed feelings about.
While some agree that Daisy brings a lot of flexibility for quick and easy prototyping, there are many that are not happy with its look & how it cripples tailwind (sizes, color pallet etc)
Library maintainers are forced to provide 2 options for their UI elements- one with Daisy and one without it.
The mix phx.new command generates a web app with daisy- so there’s no option if anyone wants to opt out.
Migrating from a generated Daisy app to a pure tailwind app is a huge headache- as simply removing Daisy wont cut it. The generated core_components.ex & root.html.heex contain references to Daisy styles which will not work out of the box with tailwind, causing unexpected behavior in many cases. Its required to change all these styles manually.
Even the dark mode toggle won’t function as expected after deleting daisy.
From the time I’ve upgraded to Phoenix 1.8 release candidates, I’ve found myself using Daisy rarely, and migrating every time has became a nuisance.
Proposed Solution
I propose we allow a --no-daisy flag to be passed when creating a new project. This creates a phoenix app with just tailwind - allowing comfortable migration for developers who want to opt out.
This will be analogous to the existing --no-tailwind flag, which creates a project without any css framework.
Would love to work on this. Any suggestions or advice is welcome! ![]()
Most Liked
josevalim
I guess I am not a serious developer nor I build serious applications, given I don’t delete them. ![]()
EDIT: expanding on the above:
-
Saying “no serious developer does X” is a “no true scotsman” fallacy. If that’s going to be an argument, then actually do a poll and understand how most people in the community use it (or not), based on their experience level, before claiming it as truth. Otherwise, it is very “convenient” to just claim that everyone who doesn’t agree is not a serious developer or not building a serious application
-
If you are going to argue in favor or against LLMs for a given setup, then please do the job of generating 100 applications across different models, comparing the different approaches, and what works and what doesn’t. That’s what Chris did for the current approach, so we at least know it works for the current version
It is worth saying that, before we added Tailwind, there was a vocal part of the community saying that the lack of styled components was a detriment to Phoenix adoption. Once we adopted Tailwind, people said that the verbose Tailwind components pushed newcomers away. So @sevenseacat is right, whatever we do, we won’t please everybody.
And perhaps you are right, maybe lack of styled components doesn’t matter when we have AI, but:
- We don’t know how many people starting new Phoenix apps are using AI
- We don’t know if the models will do a better job without CoreComponents
So if we are going to claim those as truths, then we definitely need more data to back it up.
AHBruns
I whole heartedly agree that DaisyUI should be optional (and off by default).
Charitably, it was introduced because including it makes getting a super basic pretty looking CRUD app up and running marginally faster at the expense of long term maintainability and customization. Same logic that drove CoreComponents (which are, and I can’t say this enough, terrible both from a maintainability perspective and just a “how to make a good composable UI components suite” perspective).
The problem is that in no world are the 15 minute CRUD app weekend projects (which are the only projects that benefit from these decisions) the projects that should matter when it comes to decision making for a web framework. Making development of serious, complex apps that require maintenance beyond next week easier has to take precedence, and Phoenix just seems to be missing at every turn when it comes to this metric.
arcanemachine
In that case, you should be able to justify taking an hour or so to remove daisyUI from the project and be done with it.
Personally, I don’t really like the default CoreComponents, but like so many other things in Phoenix, the framework doesn’t care what you use, and will chug along happily without daisyUI, CoreComponents, or whatever. They have to include something out of the box, and even if that something is not appropriate for everyone, the out-of-the-box experience is itself a teaching tool, which provides an example of what you can make with Phoenix. Use it, extend it, or get rid of it. The choice is yours.
I can definitely see the appeal of the pre-Tailwind CSS framework they used (Milligram IIRC?), but having something Javascript-based does highlight the capability of the built-in bundler integration.
Popular in Proposals: Ideas
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









