-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Very basic badge component #8
base: main
Are you sure you want to change the base?
Conversation
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. |
Completely agree. I think we can start with simple badge without effect and extract glow from all the components😄 |
attr(:variant, :string, doc: "Badge variant", default: "primary") | ||
|
||
attr(:class, :string, default: "", doc: "Class for badge") | ||
attr(:rest, :global) | ||
|
||
slot(:inner_block, required: true) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great - but one usecase I always have for badges is for tags and those require lots of colour variations.
Can you think of a way we can make them easily customisable from their colours without defining a variation?
Maybe a variation called colour and another prop that sets the colour? Could be done well with pattern matching.
Any update on the changes from my comment @latachz ? |
Hi @chrisgreg. I didn't have time to handle that. Feel free to mark MR as closed and implement it on your own 🙏 |
All good @latachz - thanks! |
Changes
It introduces the very initial version of Badge component with an optional glowing effect.