Skip to content

Commit

Permalink
Theme: Add workaround for unsupported CSS4 selectors (#111)
Browse files Browse the repository at this point in the history
Co-Authored-By: Kelly Dwan <ryelle@users.noreply.github.com>
  • Loading branch information
iandunn and ryelle committed Sep 1, 2022
1 parent bba962c commit 6f9e3b0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions source/wp-content/themes/wporg-main-2022/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,30 @@
padding-left: 0;
margin-bottom: 0;
}


/*
* Workaround for Gutenberg CSS4 selectors on older browsers.
*
* @link https://github.com/WordPress/gutenberg/issues/43723.
*
* Reproducing gutenberg_get_layout_style() isn't practical, so this just hardcodes the needed values.
*
* Remove this when the above issue is fixed in a stable release.
*/

body .is-layout-constrained > * {
max-width: var(--wp--style--global--content-size);
margin-left: auto !important;
margin-right: auto !important;
}

body .is-layout-constrained > .alignwide {
max-width: var(--wp--style--global--wide-size);
}

body .is-layout-constrained > .alignfull {
max-width: unset;
margin-left: unset !important;
margin-right: unset !important;
}

0 comments on commit 6f9e3b0

Please sign in to comment.