Skip to content
Merged
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
7 changes: 5 additions & 2 deletions packages/block-library/src/columns/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
overflow-wrap: break-word; // New standard.

// Between mobile and large viewports, allow 2 columns.
@include break-small() {
flex-basis: calc(50% - #{$grid-unit-20});
@media (min-width: #{ ($break-small) }) and (max-width: #{ ($break-medium - 1) }) {
// As with mobile styles, this must be important since the Column
// assigns its own width as an inline style, which should take effect
// starting at `break-medium`.
flex-basis: calc(50% - #{$grid-unit-20}) !important;
flex-grow: 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there are two other styles here that will now only take effect between $break-small and $break-medium - 1:

  • flex-grow
  • :nth-child( even ) { margin-left }

As far as I see it, this is not only fine, but in-fact preferable, since these styles are specific to how the columns are presented in the mid-range viewport (with 50% width).

Practically speaking, it should have no effective difference either, since:

  • flex-grow is overridden at break-medium
  • margin-left is assigned to the same value $grid-unit-20 * 2 at break-medium for :not(:first-child), which includes (is a superset of) :nth-child(even)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, if complex :)
Thank you for doing this.


// Add space between the multiple columns. Themes can customize this if they wish to work differently.
Expand Down