robsontenorio / mary

Laravel Blade UI Components for Livewire 3
https://mary-ui.com
Other
1.05k stars 132 forks source link

x-badge should not implement a fixed height #715

Closed flatcapco closed 2 hours ago

flatcapco commented 3 hours ago
utilises height:1.25rem by default. This should be removed because the badge style breaks badly when using a long badge name or on smaller views like mobile However if a badge has a long label which is not uncommon especially for a 2 word label to break onto 2 lines on mobile views. Currently: https://capture.dropbox.com/5aXaloiKAujIX6O3 Height removed: https://capture.dropbox.com/dz4y6bxuLs3PksKL
flatcapco commented 3 hours ago

Just to clarify - h-auto text-center should be the default

robsontenorio commented 3 hours ago

What code are you trying ?

flatcapco commented 3 hours ago

What code are you trying ?

Just the standard badge needs these classes to make it responsive:

                <x-badge
                    class="badge-primary h-auto text-center"
                    value="A long text example"
                />
robsontenorio commented 2 hours ago

maryUI does not put any extra class, see.

https://github.com/robsontenorio/mary/blob/main/src/View/Components/Badge.php#L23

All is handled by daisyUI. In this case you need to use Tailwind class to override the default behavior, for your scenario.

flatcapco commented 2 hours ago

maryUI does not put any extra class, see.

https://github.com/robsontenorio/mary/blob/main/src/View/Components/Badge.php#L23

All is handled by daisyUI. In this case you need to use Tailwind class to override the default behavior, for your scenario.

I did see that line - and I appreciate that you don't, I'll take it up with DaisyUI if its not something you'd like to handle at this level

robsontenorio commented 2 hours ago

We rely on daisyUI base classes. And this is a very specific scenario for badges. Fine tuning is always available with custom css/Tailwind classes.

flatcapco commented 2 hours ago

Thats ok - I've posted on the Daisy discussion. I think its a sensible default that shouldn't need custom css, and even though its easy to overwrite that doesn't improve the default framework which would help for more adopters

robsontenorio commented 2 hours ago

You find a solution that does not break the current default I would be happy to merge the PR. Thanks!