-
Notifications
You must be signed in to change notification settings - Fork 43
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
Columns Block: remove custom column block styles #1133
Conversation
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.
This one is a doozy because there are SO many variations of content that need to be handled. I ran into a few issues an issue (the others were due to me not having the right Theme branch checked out 🤦 ) with the test content you provided, confirmed in both Chrome and Firefox.
The four-columns-with-border-don't-stack-on-mobile styles appear broken on mobile. This happens with both WP 5.9.3 and 6.0. Only seems to affect this particular combination of styles with more than three columns, but the borders appear off-center at mobile breakpoints:
Thanks @dkoo! 🙏
I think this might have to do with my test content, and the fact the border styles eat up a lot of space. I tried adding red borders to the Though it's an edge case, this isn't great 😕 I've decreased the column gap a bit for these not-stacked columns on smaller screens in a683470 -- I don't think it'll fix it if you switch to five columns, but at that point I think you could truly argue it's something you shouldn't be doing:
This is absolutely correct -- you can't add multiple block styles to the columns. You can manually add one of the block style classes though -- and I know we've done this in the past 😬 So I included some cases like that to make sure things will still look okay. |
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 think this might have to do with my test content, and the fact the border styles eat up a lot of space. I tried adding red borders to the .wp-block-column blocks on my test site, and made the paragraphs semi-transparent -- it helps show that the borders are aligned correctly, but the paragraphs are overflowing the available space:
I see what you mean. This is an extreme edge case, anyway, and the tweak does help this particular test content look better at small viewports.
Thanks @dkoo! |
# [1.52.0-alpha.1](v1.51.0...v1.52.0-alpha.1) (2022-06-02) ### Bug Fixes * correct donate block tab spacing in editor ([#1153](#1153)) ([c17221f](c17221f)) * disambiguate WP users vs. guest authors with same ID ([#1143](#1143)) ([d3c5920](d3c5920)) * echo closing link tags on sponsor bylines ([#1152](#1152)) ([f80893f](f80893f)) * remove custom column block styles ([#1133](#1133)) ([bd79783](bd79783)) * skipped linked images when navigating blocks by keyboard ([#1144](#1144)) ([8975787](8975787)) ### Features * add new subscribe pattern ([#1142](#1142)) ([97d632e](97d632e)) * remove support for the Aside post format ([#1139](#1139)) ([9f9cdf4](9f9cdf4))
🎉 This PR is included in version 1.52.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.52.0](v1.51.0...v1.52.0) (2022-06-13) ### Bug Fixes * correct donate block tab spacing in editor ([#1153](#1153)) ([c17221f](c17221f)) * disambiguate WP users vs. guest authors with same ID ([#1143](#1143)) ([d3c5920](d3c5920)) * echo closing link tags on sponsor bylines ([#1152](#1152)) ([f80893f](f80893f)) * remove custom column block styles ([#1133](#1133)) ([bd79783](bd79783)) * skipped linked images when navigating blocks by keyboard ([#1144](#1144)) ([8975787](8975787)) ### Features * add new subscribe pattern ([#1142](#1142)) ([97d632e](97d632e)) * remove support for the Aside post format ([#1139](#1139)) ([9f9cdf4](9f9cdf4))
🎉 This PR is included in version 1.52.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
The Columns Block is being reworked in WP 6.0: the responsive behaviour is getting updated, and the block is moving from using
margin
to add space between the columns to usinggap
.Originally the Columns block would break into two columns at the tablet breakpoint, and one column on mobile. This created a weird "orphaned" column situation when you had an odd number of columns, so we included some styles in the Newspack Blocks plugin to override it and make the columns number remain the same until the mobile breakpoint.
In 6.0, the Columns block will now switch to one column on tablet-sized screens, which is very close to our Newspack-specific overrides.
Here's a screenshot of the Core columns block (minus any Newspack styles) with the new breakpoint behaviour from 6.0 on the left, and the original breakpoint behaviour on the right:
It makes sense to remove our custom styles now since the Core behaviour will work well on our sites, and it'll save us having to make extensive updates every time the Columns block is updated going forward. This PR removes the unneeded columns styles, and switches the block to use
gap
instead ofmargin
for column spacing. It also includes some 5.9-specific styles, so these changes can be pushed out prior to 6.0 without breaking anything.This PR needs to be tested with Automattic/newspack-theme#1801, which removes some related styles from the theme as well.
Closes #1128, #1065 and Automattic/newspack-theme#840
How to test the changes in this Pull Request:
Note: To test this PR, you'll need test sites where you can run the latest WP 6.0 RC, and WP 5.9.3. You can do this by testing on two sites, or using the WordPress Beta Tester plugin to switch a single site.
Start with a test site using WordPress 5.9.3.
Add a series of column blocks to the editor -- I would recommend including combinations of the following:
(I created some test content that can be used as a starting point; I would recommend adding some more columns, though, in case you find things I didn't!)
View the blocks on the front-end at varying screen sizes, noting how the borders look, and when the reordered blocks switch order -- all that fun stuff.
5.9 current screenshots
Desktop
Tablet
Mobile
Desktop
Tablet
Mobile
Desktop
npm run build
on each.npm run build
on each.Subscribe Pattern 9 - WP 5.9
Desktop:
Tablet:
Mobile:
Subscribe Pattern 9 - WP 6.0
Desktop:
Tablet:
Mobile:
Other information: