coen.bakker
I’ve been using nested CSS but I need to support older browsers. My Phoenix app uses the default Esbuild setup, so I looked for support for unnesting CSS.
The Esbuild 0.17.14 release notes mentions CSS flattening.
I cannot seem to get it to work in my Phoenix app, though.
I changed the Esbuild installer to the latest version and added the --target tag to the build statement.
defp deps do
[
{:esbuild, "~> 0.8.1", runtime: Mix.env() == :dev},
]
end
defp aliases do
[
"assets.build": ["esbuild default --target=#{build_target()}"],
"assets.deploy": ["esbuild default --minify --target=#{build_target()}", "phx.digest"]
]
end
defp build_target(), do: "es2016,chrome88,edge109,firefox115,safari11"
However, when I run the build, the generated CSS is still nested.
Is the Esbuild installer behind, maybe? Or am I missing something else?
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
I’ve released BeamConsole 0.1.0, an embeddable, read-only process flight recorder and process map for Phoenix and BEAM applications.
Its...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #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)
hubertlepicki
this is because Elixir packate
:esbuildonly ships with 0.17.11 version of esbuild, and you need at lesast mentioned 0.17.14:https://github.com/phoenixframework/esbuild/blob/v0.8.1/lib/esbuild.ex#L3C21-L3C27
hubertlepicki
Looking at that library source, it appears you can force the version you need with:
and then running
mix esbuild.installcoen.bakker
Thank you.
I have changed the config to this.
I set the version to
0.19.11because I noticed some changes to how nested CSS is parsed in versions after0.17.14.I also included
import '../css/app.css';in myjs/app.jsafter reading the Esbuild docs about CSS, because otherwise the CSS was still not flattened. Not sure why.coen.bakker
Actually, there was some more unexpected behaviour, even with
import '../css/app.css';.It seems to do with the fact that I still had Tailwind installed and configured. Did a quick test and seems like removing Tailwind solves the problem.
TwistingTwists
So then you don’t need taliwind, is it?
Only esbuild is sufficient?
coen.bakker
I tried Tailwind. I wanted to give it a fair shot. At this point I don’t want to use it for my projects. But I’ll continue keeping an eye on it
.
tj0
I’ve used this to flatten in my configuration. Not using taliwind though.
coen.bakker
Ty for your message on Fly.io.
In case someone is interested, on Fly.io I asked “Can I use Esbuild version 0.19.11 instead of 0.17.11 with Phoenix LiveView?”.
This was after I successfully flattened the nested CSS in local development, after the help in this Elixir Forum topic. In production with Fly.io it did not work. Not yet, at least. Also after trying version 0.17.18.
tj0
Did you try with the lower targets?
Edit: Ah, re-read this. If it successfully worked in dev and not in prod, there must a difference in the esbuild configuration between the two environments?
coen.bakker
Actually, now it does flatten. This was indeed the change I made. Which is a head scratcher, since setting
--target=es2017,chrome88did work locally.Still get super weird styling on iOS on real iPhones and iPads… Must be something else going on then, besides the nested CSS.
Confused at this point.
But I’ll keep trying to figure out what is going on.
Edit. On Xcode’s Simulator it does work on iOS.