Post

What are some good patterns for if/else conditional tailwind classes in a Phoenix LiveView component? #ElixirLang #ElixirPhoenix #TailwindCSS

0 reposts2 likes

In more complex cases, I prefer to use a list, so that you have one set of classes common to all states, and other lists for different conditions. E.g. this snippet from core components. This way you might need to explicitly write the opposite of though.

Btw i was reading about Surface and if i understand correctly is a compiler on top of liveview. Looks cool but i think something like tails is more close to the metal and easy to port. I'm still debating myself