Skip to content
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

Flux:buttons are at different vertical offsets and sizes, depending on content #728

Open
rikh42 opened this issue Nov 23, 2024 · 3 comments

Comments

@rikh42
Copy link

rikh42 commented Nov 23, 2024

This means that they appear out of line, with some higher up than other.

For example, with the following markup...

<div class="my-12">
    <flux:button icon-trailing="chevron-down">Layout</flux:button>
    <flux:button icon-trailing="chevron-down"></flux:button>
    <flux:button><flux:icon.chevron-down /></flux:button>
    <flux:button square><flux:icon.chevron-down /></flux:button>
</div>

Results in the following buttons that are all over the place...

Image

I have tried this in Chrome and Firefox, with the same result.

I would expect all the buttons to have the same vertical height and same baseline

Thank you!

@jeffchown
Copy link

@rikh42 See @calebporzio 's response (underneath my comment) here #499 (comment)

@rikh42
Copy link
Author

rikh42 commented Nov 24, 2024

OK, but is it possible to create a flux:button with only an icon in it, that lines up with a flux:button that also contains text?

In the example above, the only difference between the first two is that the first also has some text content.

If I adjust the other two, which involve a separate flux:icon, to use the micro size, they still don't line up with the first example.

@jeffchown
Copy link

jeffchown commented Nov 24, 2024

@rikh42 I usually wrap my button groups like this:

<div class="flex items-center space-x-3">
    <flux:button type="submit" variant="primary">Save</flux:button>

    <flux:button type="button" variant="danger">Cancel</flux:button>

    ...more buttons...
</div>

That way, as long as the buttons are the same height, they will align properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants