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

remove broken 2-column breakpoint from columns block #13605

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 7 additions & 25 deletions packages/block-library/src/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
padding-left: $block-padding;
padding-right: $block-padding;

@include break-small() {
@include break-medium() {
padding-left: $block-padding + $block-padding + $block-side-ui-width + $block-side-ui-clearance + $block-side-ui-clearance;
padding-right: $block-padding + $block-padding + $block-side-ui-width + $block-side-ui-clearance + $block-side-ui-clearance;
}
Expand All @@ -35,15 +35,15 @@
// Responsiveness: Allow wrapping on mobile.
flex-wrap: wrap;

@include break-small() {
@include break-medium() {
flex-wrap: nowrap;
}

// Adjust the individual column block.
> [data-type="core/column"] {
display: flex;
flex-direction: column;
flex: 1;
margin-bottom: calc(1em + #{$block-padding});

// The Column block is a child of the Columns block and is mostly a passthrough container.
// Therefore it shouldn't add additional paddings and margins, so we reset these, and compensate for margins.
Expand Down Expand Up @@ -85,33 +85,15 @@
overflow-wrap: break-word; // New standard.

// Responsiveness: Show at most one columns on mobile.
flex-basis: 100%;
width: 100%;

// Beyond mobile, allow 2 columns.
@include break-small() {
flex-basis: 50%;
flex-grow: 0;
}

// Add space between columns. Themes can customize this if they wish to work differently.
// This has to match the same padding applied in style.scss.
// 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;
}
}

@include break-small() {
@include break-medium() {
&:not(:first-child) {
margin-left: $grid-size-large * 2;
margin-left: $grid-size-large + $block-padding;
}

&:not(:last-child) {
margin-right: $grid-size-large * 2;
margin-right: $grid-size-large + $block-padding;
}
}
}
Expand Down
21 changes: 4 additions & 17 deletions packages/block-library/src/columns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@
}

.wp-block-column {
flex: 1;
margin-bottom: 1em;

// Responsiveness: Show at most one columns on mobile.
flex-basis: 100%;

// Beyond mobile, allow 2 columns.
@include break-small() {
flex-basis: 50%;
flex-grow: 0;
}
width: 100%;

// Prevent the columns from growing wider than their distributed sizes.
min-width: 0;
Expand All @@ -31,20 +24,14 @@

// 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;
}
@include break-medium() {

&:not(:first-child) {
margin-left: $grid-size-large * 2;
margin-left: $grid-size-large;
}

&:not(:last-child) {
margin-right: $grid-size-large * 2;
margin-right: $grid-size-large;
}
}
}