Skip to content

Updated alignment styles#4501

Open
girishpanchal30 wants to merge 3 commits into
developmentfrom
bugfix/4427
Open

Updated alignment styles#4501
girishpanchal30 wants to merge 3 commits into
developmentfrom
bugfix/4427

Conversation

@girishpanchal30
Copy link
Copy Markdown
Contributor

Summary

Ensured that full-width and wide-aligned blocks (.alignfull, .alignwide) display correctly within various container and layout contexts, especially when sidebars or constrained layouts are present. The main changes improve consistency and responsiveness of block alignment across different layouts.

Check before Pull Request is ready:

Closes #4427

@girishpanchal30 girishpanchal30 requested a review from Copilot May 18, 2026 13:17
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label May 18, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label May 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the SCSS rules that constrain .alignfull / .alignwide Gutenberg blocks so they render correctly when nested inside columns and constrained layouts (Section block + Heading template scenario from issue #4427). Adds explicit width: 100% and applies the constraint to a broader set of container selectors in both the legacy (assets/scss/main/_gutenberg.scss) and the components (assets/scss/components/main/_gutenberg.scss) stylesheets.

Changes:

  • Add width: 100% to the sidebar-scoped .alignfull/.alignwide reset and reformat the selector list.
  • Add a new top-level rule covering .wp-block-column, .is-layout-constrained, and any [class*="wp-block-"] element with a wp-block child (via :has()) that resets nested full/wide alignments.
  • Mirror the new rule in the components stylesheet by extending the existing sidebar selector list.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
assets/scss/main/_gutenberg.scss Adds width: 100% to sidebar-scoped reset and introduces a new top-level rule for columns/constrained/:has() wrappers, using margin: 0.
assets/scss/components/main/_gutenberg.scss Extends the existing sidebar selector list with the same column/constrained/:has() selectors and adds width: 100%, but uses margin: auto.
Comments suppressed due to low confidence (2)

assets/scss/main/_gutenberg.scss:31

  • The selector [class*="wp-block-"]:has(> [class*="wp-block-"]):not(.alignfull):not(.alignwide) is extremely broad — it matches any element whose class string contains the substring wp-block- and that has any direct child whose class string contains wp-block-. This will include blocks well beyond the targeted "Section/Group" case from issue #4427, e.g. .wp-block-cover, .wp-block-media-text, .wp-block-group, .wp-block-columns, .wp-block-quote, etc. (and also third‑party blocks such as Otter blocks like wp-block-themeisle-blocks-…). For all of those, nested .alignfull/.alignwide children will be forced to width: 100%; max-width: 100%, which is a much wider behavioural change than the PR description suggests and may regress existing layouts where full‑width breakout inside e.g. a Cover or Group block was previously working.

Consider narrowing the selector to the specific containers you actually need to fix (for example, .wp-block-column, and any specific block wrappers reported in the issue) rather than relying on a wildcard attribute selector combined with :has().

[class*="wp-block-"]:has(> [class*="wp-block-"]):not(.alignfull):not(.alignwide) {

assets/scss/components/main/_gutenberg.scss:52

  • Same concern as in assets/scss/main/_gutenberg.scss: the [class*="wp-block-"]:has(> [class*="wp-block-"]):not(.alignfull):not(.alignwide) selector is too broad and will affect many block types beyond columns/section blocks (e.g. .wp-block-cover, .wp-block-group, .wp-block-media-text, third-party blocks with wp-block- class prefixes). Consider scoping this to the specific containers from the bug report.
[class*="wp-block-"]:has(> [class*="wp-block-"]):not(.alignfull):not(.alignwide) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread assets/scss/main/_gutenberg.scss Outdated
Comment thread assets/scss/components/main/_gutenberg.scss
@pirate-bot
Copy link
Copy Markdown
Collaborator

pirate-bot commented May 18, 2026

Plugin build for 5f84139 is ready 🛎️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants