-
Notifications
You must be signed in to change notification settings - Fork 65
fix(card header): Make card header flex by default (#1253) #1254
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
Conversation
|
bslib/inst/bslib-scss/spacer.scss Lines 22 to 32 in 07552c8
|
gadenbuie
left a comment
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.
All good to merge once the last couple details are handled
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>
gadenbuie
left a comment
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.
Looks good, one more thing to track down to see if we can simplify before merging!
gadenbuie
left a comment
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.
Thank you!
This PR makes card headers flex by default, with equivalent settings to
.hstack.This makes it much easier to organize complex inputs in headers with vanilla formatting or using other spacing utils to control how the items are spaced within the header.
We are not adding this to footers because it seems like footers are more likely to be longer blocks of text, like figure captions, footnotes, etc.
Minor breakage is possible for people currently expecting vertically stacked inputs in headers, however based on a quick survey of publicly available code on GitHub, this seems to be a very, very small population.
An example with a few inputs in a header:
An example with
ms-autopushing the second part of the header to the far right:Interactions with Nav implementations &
nav_spacerUpdates to the
card_headerscss were made in order to implement the following behaviors:If a card uses a nav implementation like
navset_card_tab, everything will behave normally, including spacers.`nav_spacer` will also work correctly in a `card_header`, even if no other nav items are present:
If there is both a nav container with a `nav_spacer` and other flex items in the card header, the nav will use the spacer but leave room for the remaining items: