-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: Use margin-bottom/gap spacing in more places #725
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Classes are `.bslib-mb-spacing` and `.bslib-gap-spacing`, vars is `-spacer`.
cpsievert
reviewed
Aug 4, 2023
cpsievert
reviewed
Aug 4, 2023
cpsievert
reviewed
Aug 4, 2023
cpsievert
reviewed
Aug 4, 2023
… only Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
cpsievert
approved these changes
Aug 4, 2023
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.
Thanks, probably worth a NEWS item?
I added a news item for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #672
For consistency, I renamed
.bslib-mb-spacer
to.bslib-mb-spacing
. I'm hoping this helps when trying to remember the class/variable names. The reasoning is that--bslib-spacer
(the custom CSS property) is non-commital since it hasn't been applied anywhere.--bslib-mb-spacer
is a similar unit. But once it's a class, we use-spacing
, i.e..bslib-gap-spacing
and.bslib-mb-spacing
, which I read as "the elements in this container use gap spacing or this element uses margin bottom spacing". Obviously, it's not perfect..bslib-mb
or.mb-bslib
instead, since there is a difference that this class directly sets the margin bottom of the current element.While here I added something that feels relevant: setting
margin-bottom: 0
on fill items with bslib's margin bottom spacing that are activated within a fillable container.layout_columns()
andlayout_column_wrap()
gain the.bslib-mb-spacing
class so that they naturally have some bottom margin in a flow context. This also motivated adding the above consideration for.bslib-mb-spacing
fill items.sidebar()
gainsgap
andpadding
arguments to control the gap and padding within the sidebar itself.gap
picks up from--bslib-spacer
or the inline style, and I added a CSS variables--bslib-sidebar-content-padding
because--bslib-sidebar-padding
needs to be a single value and is used in a few places that aren't specifically apadding
property. The.sidebar-content
container also gains the.bslib-gap-spacing
so that bottom margin is dropped in sidebars in favor of thegap
spacing.