Allow to hide a button's label on smaller screens, keep icon #2359
Unanswered
lode
asked this question in
Feature Requests
Replies: 2 comments 4 replies
|
@lode Wouldn't something like this work?: <div class="flex items-center gap-3">
<flux:button class="flex items-center lg:gap-2">
<flux:icon.chevron-left />
<span class="hidden lg:inline-block">Previous</span>
</flux:button>
<flux:button class="flex items-center lg:gap-2">
<span class="hidden lg:inline-block">Next</span>
<flux:icon.chevron-right />
</flux:button>
</div>
|
0 replies
|
Might yeah. Still feels like quite a lot of code for something that is so common. Plus the button with an empty content vs button without a closing tag feels like a bug. |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
I often find myself creating two buttons, one for small screens with only the icon, and one for bigger screens with icon and label.
However the code that I have to write becomes a bit ugly:
Especially when the button has more arguments, like I found this in my code:
The nicer alternative code-wise would be to only hide the label text on smaller screens:
However, this changes how buttons are styled, keeping space for an empty label (top how this looks, bottom how it should look):
It would be great if this can be solved inside Flux. With something like:
All reactions