Skip to content

Commit

Permalink
layout fix for content width blocks nested in full width blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiepaul committed Aug 4, 2023
1 parent 763172c commit 0cc3ba7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions wp-content/themes/core/assets/pcss/layout/default.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@
*
* ------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
*
* Layout: Align None (Content Width)
*
* Adjustments for content width blocks nested inside alignfull container blocks
* For blocks w/ align none nested inside container block with alignfull and
* constrained layout.
*
* ------------------------------------------------------------------------- */

/*
* CASE: useRootPaddingAwareAlignments = true
*
* WP styles remove padding from blocks nested in .has-global-padding.alignfull.
*
* Padding is added back to prevent contentWidth blocks from bumping up to
* the viewport edge. Negative margins are set to ensure the block's
* contents fill the contentWidth setting in theme.json
*
* Screenshot: http://p.tri.be/i/oaIM0F
*/
.has-global-padding > .alignfull:where(.has-global-padding) > :where(:not(.alignfull):not(.alignwide)) {
padding-right: var(--wp--style--root--padding-right);
padding-left: var(--wp--style--root--padding-left);
max-width: calc(var(--wp--style--global--content-size) + var(--wp--style--root--padding-left) * 2);
}

/* -------------------------------------------------------------------------
*
* Layout: Align Wide
Expand Down

0 comments on commit 0cc3ba7

Please sign in to comment.