chrisgreg / bloom

The opinionated extension to Phoenix core_components
https://bloom-ui.fly.dev
MIT License
347 stars 18 forks source link

feat: Very basic badge component #8

Open latachz opened 6 months ago

latachz commented 6 months ago

Changes

It introduces the very initial version of Badge component with an optional glowing effect.

image
zachallaun commented 6 months ago

Drive-by comment that you both should feel free to take with a grain of salt:

The glow effect is neat but seems much more general than something that should appear on a component like a badge. It seems like it could be useful for many elements, including buttons, cards, etc. Is it possible to implement it in a way that composes with components instead of needing to modify every component that might possibly want it?

<.glow from_color="..." to_color="...">
  <.badge>Badge</.badge>
</.glow>

<.glow from_color="..." to_color="...">
  <.button>Button</.button>
</.glow>

This would also facilitate enhancing the effect later with modifiers for size, single color, etc.

chrisgreg commented 6 months ago

Drive-by comment that you both should feel free to take with a grain of salt:

The glow effect is neat but seems much more general than something that should appear on a component like a badge. It seems like it could be useful for many elements, including buttons, cards, etc. Is it possible to implement it in a way that composes with components instead of needing to modify every component that might possibly want it?

<.glow from_color="..." to_color="...">
  <.badge>Badge</.badge>
</.glow>

<.glow from_color="..." to_color="...">
  <.button>Button</.button>
</.glow>

This would also facilitate enhancing the effect later with modifiers for size, single color, etc.

I agree, Glow should be extracted out to be used on whatever a consumer wants. It shouldn't inherently be part of a badge.

latachz commented 6 months ago

Completely agree. I think we can start with simple badge without effect and extract glow from all the components😄

chrisgreg commented 1 month ago

Any update on the changes from my comment @latachz ?

latachz commented 1 month ago

Hi @chrisgreg. I didn't have time to handle that. Feel free to mark MR as closed and implement it on your own 🙏

chrisgreg commented 1 month ago

All good @latachz - thanks!