arcanemachine

arcanemachine

I used daisyUI for a couple projects a while back, and it uses a Bootstrap-esque naming scheme for its colors (which are also fully customizable). Instead of hardcoding colors like bg-zinc-500, you just specify bg-secondary. I found it to work pretty well, and it makes it trivial to add additional themes, or modify existing ones (just change the color definitions in the tailwind.config.js file).

Component demos: Component Showcase - Quiz Game (You can change the theme by clicking the gear icon in the top-right corner.)

GitHub code:

0
Post #21
thiagomajesk

thiagomajesk

Hi @arcanemachine, thanks for your contribution but this is unrelated to the problem I’m afraid :sweat_smile:.. The point has more to do with how feedback state is being handled on inputs than what styling library to use, so using a different class name or library doesn’t really address the concerns posted by @AHBruns. Cheers!

0
Post #22
arcanemachine

arcanemachine

The point is that you can use semantic class names instead of hardcoding color names. My input component can support a infinite variety of color themes without modifying the CSS of the component. The specific library is irrelevant. daisyUI happens to have the ability to do this. You don’t have to use the library to utilize the technique.

0
Post #23
steffend

steffend

Phoenix Core Team

btw there is work in progress to remove phx-no-feedback: https://github.com/phoenixframework/phoenix_live_view/pull/3090

The idea here is to only add the error classes server side if used_input?(field) returns true.

3
Post #24
thiagomajesk

thiagomajesk

Awesome! That’s exactly what I was looking for, thanks for sharing @steffend.

0
Post #25
— All posts loaded —