-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove unintentional right-margin on last odd-item. #12199
Changes from 1 commit
89a9859
ce9ff9a
3930c4a
b28e9af
ace6ef4
3b812ba
66ed077
e8acfd0
7f5fe9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,41 +10,36 @@ | |
} | ||
|
||
.wp-block-column { | ||
flex: 1; | ||
flex-grow: 1; | ||
margin-bottom: 1em; | ||
|
||
// Responsiveness: Show at most one columns on mobile. | ||
flex-basis: 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we change this to (content < width < flex-basis) |
||
|
||
// Beyond mobile, allow 2 columns. | ||
@include break-small() { | ||
flex-basis: 50%; | ||
flex-grow: 0; | ||
} | ||
|
||
// Prevent the columns from growing wider than their distributed sizes. | ||
min-width: 0; | ||
|
||
// Prevent long unbroken words from overflowing. | ||
word-break: break-word; // For back-compat. | ||
overflow-wrap: break-word; // New standard. | ||
|
||
// Add space between columns. Themes can customize this if they wish to work differently. | ||
// Only apply this beyond the mobile breakpoint, as there's only a single column on mobile. | ||
@include break-small() { | ||
&:nth-child(odd) { | ||
margin-right: $grid-size-large * 2; | ||
} | ||
&:nth-child(even) { | ||
margin-left: $grid-size-large * 2; | ||
} | ||
|
||
&:not(:first-child) { | ||
margin-left: $grid-size-large * 2; | ||
// Beyond mobile, allow 2 columns. | ||
flex-basis: 50%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're getting rid of the 2-column breakpoint, then |
||
flex-grow: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// Add space between columns. Themes can customize this if they wish to work differently. | ||
// Only apply this beyond the mobile breakpoint, as there's only a single column on mobile. | ||
margin-right: $grid-size-large * 2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These seem like a generally much easier set of rules to follow. I kept thinking I'd have thought this would have the effect of doubling up the margin from what had existed previously since only one or the other horizontal margin was applied, but I realized after some time I'd totally missed the previous There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
margin-left: $grid-size-large * 2; | ||
|
||
&:first-child { | ||
margin-left: 0; | ||
} | ||
|
||
&:not(:last-child) { | ||
margin-right: $grid-size-large * 2; | ||
&:last-child { | ||
margin-right: 0; | ||
} | ||
} | ||
} |
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.
I don't think this property is necessary since we are setting the width to 100% below.