cortfritz

cortfritz

Would the Phoenix maintainers - and the community - welcome a PR adding dark mode with selectors consistently to all phx gen templates?

Each time i use phx.gen I end up adding dark mode to it.

I’m offering to add this to the default phx gen templates.

This would

  • use tailwind
  • add new tailwind customization into tailwind.config.js? or wherever you prefer.
  • update core_components and each template
  • put a toggle affordance in the nav
  • default to local preference
  • set toggle state in browser session, overriding preference
  • leave the main phx home page alone
  • happy to also pick up any existing template bugs since i’m in there already - e.g. index page table row hover bg color right column inconsistent height.

I hope you:

  • find this proposal considerate!
  • …clear
  • …worth considering - dark mode feels like a nice default thing to add.

I’ve seen dark mode “how do i” threads in this forum but do not see a proposal to implement. I think LLM agents make this pretty cheap - that’s how i do it each time i start a new project and this feels like it would be similar to one of my one offs but just more extensive and more carefully tested.

I’m open to working with others but happy to just do this myself.

Most Liked

chrismccord

chrismccord

Creator of Phoenix

As Steffen said @cblavier has been exploring what dark mode would look like code wise and initial results are promising. We told Christian we’d need to see code side by side to see if it’s overwhelming or not. I’m camp dark-mode-everything fwiw, so we’ll see!

cblavier

cblavier

Here is what I did on the core component’s input to support dark mode properly using Tailwind’s dark:selector

:backhand_index_pointing_right: Here is the code diff.

If you think the added code is small enough, I can open a PR on Phoenix to update core_component’s generators.

Before:

After:

sodapopcan

sodapopcan

I’m not sure why anyone wouldn’t be happy with this :sweat_smile: I’m not on or close to the Phoenix team but I’m guessing this is one of those non-pressing issues that is merely waiting for someone like you to come along. Just a guess, though! A big plus one from me, and I’m not even a dark mode user.

Where Next?

Popular in Proposals: Ideas Top

mssantosdev
Hey, everyone. I’ve been working with Phoenix Components for a few weeks, and they are great. One thing I use a lot when building custom...
New
dimitarvp
To @jonatanklosko and @the-mikedavis: I see that there is a Rust crate at crates.io: Rust Package Registry but it is pointing at https:/...
New
dkuku
This is a proposal to make the map key mismatch errors a bit better: Every time I have a typo It’s very challenging for me even when I u...
New
Aduril
Hello there, Whenever I setup a new project, there is a small function I always add: reply/1. What does it do? In a LiveView mount, han...
New
altdsoy
Hi there :wave:, I hope everyone is doing well… Tl;Dr: Is there a use case to have Heroicons from an actual hex.pm package instead of G...
New
dvartic
Would there be interest to implement a link/1 that gives to option to operate on other events? So I implemented a simple link/1 function...
New
cheerfulstoic
I feel like Elixir is getting big enough and old enough that I’m starting to experience problems with conflicting dependencies. An examp...
New
GregPhx
Greetings Everyone!!! A little bit of my background so it could be easier to understand where my comments are coming from, and to take t...
New
Rubas
Current Challenge When testing LiveViews that use assign_async, we can’t really operate on the async data. render_async(view) waits f...
New
cgraham
Please change passwordless login from a link to a 6-8 digit code a user can enter. Gen Auth in the latest RC 1.8 of Phoenix defaults ...
New

Other popular topics Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement