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
ButtonGroup doesn't apply margin when children are different HTML elements #688
Comments
Thanks for the report @larimaza! This is a tricky one: Emotion puts constraints on the use of The alternative is to iterate over the child elements with React's Another option would be to insert a spacer |
Tricky indeed 😬 TBH, I don't love the idea of adding a spacer The other solution is also not very nice, but... We could add a margin to every child and then counter the last one's margin in the button group itself. |
That's better indeed. Emotion doesn't restrict the |
@connor-baer I can work on work on this! |
@robinjimenez Awesome! 🙌 Could you open a PR with the changes, please? |
🎉 This issue has been resolved in version 2.4.0-canary.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 2.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Component to amend
ButtonGroup
Visual
a
button
Context
The ButtonGroup should apply margins between the buttons inside it for all cases.
However, because of selectors like this:
...when the first button is an anchor and the other is a button, the margin is not applied, since the
a
is the last of its type.The proposal would be to use the broader selector
:last-child
, since it's unlikely that the ButtonGroup will have another child that isn't ana
or abutton
(and if it has, it's a wrong use of the component).The text was updated successfully, but these errors were encountered: