tcoopman
I thought I’d try to install tailwind 4.0.0-beta.1 (Release v4.0.0-beta.1 · tailwindlabs/tailwindcss · GitHub) that was released today and see how far I got.
Tailwind 4 has some big changes so I don’t expect this to work out-of-the box without any work, but I thought I’d try and see how far I get.
so, I changed the config to
config :tailwind,
version: "4.0.0-beta.1",
and did a mix tailwind.install, changed the css file according to Installing Tailwind CSS with Vite - Tailwind CSS
and everything seems to run fine, but I don’t get my classes detected.
If I run _build/tailwind-linux-x64 -i assets/css/app.css -o test.css directly, the css file is correct, so it must be something with the arguments that’s different (I think).
Will play a little bit more around and see if I can get it working completely.
Trending in Discussions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tcoopman
Got it working:
This is a working config:
diff:
As you can see, the difference is to not
cdinto assets. Tailwind 4 does source detection differently, but you can still configure it: Installing Tailwind CSS with Vite - Tailwind CSS, so the old configuration can probably be kept with correct source detection, but I didn’t bother with that.sucipto
also work with custom class like
min-w-[200px]with this new source code detection?tcoopman
I don’t see why this would not work?
frankdugan3
I’ve been using the alpha for a few months, and I prefer using the new configuration in the
app.cssfile and deleting the js config. I did not change theconfig.exs, so it still does thecdinto the assets directory.And create a
heroicons.tailwind.plugin.jsif you use heroicons:I think v4 is a fantastic advancement. It uses native CSS layers, which I find solves all problems I have with using selectors for the base style of components, while still allowing the use of utility classes for overrides.
cvkmohan
Does this go into
app.css?Additionally - do we need
@source?frankdugan3
Yes and yes. It’s possible they may add automatic detection logic specifically for the structure of Phoenix, but even if they do that, I prefer being explicit about sources to avoid ever having a problem.
cvkmohan
Thanks a lot. I guess that @source part is not yet working in phoenix application. Once I added that, it started working.
frankdugan3
As a follow-up, here’s a gist with a simple & robust implementation of dark mode toggling. It contains the config to add to
app.css, and button and JS components to add to yourcore_components.exfile.Terbium-135
I gave the tailwind 4 beta a try…
But the layout looks so different compared to V3
As far as I understood
@themeshould overwrite the defaults likeextenddoesin the
tailwind.config.jsfile for V3With this in my app.css file:
it looks like I have no
lg:media selector or any other at all..I tried to find some information over at tailwind but github discussion and discord is a mess (at least for me)
Where do I have to look at/search for?
I am aware that this is a beta and V3 does the job
Was just curious and wanted to test some of the new features
Best regards
sushilbansal
everything worked except that tailwind auto suggest is not working. Did you face the same problem @frankdugan3 ?