From bf82761f0a1c5c3abb5daf3c18964312ab61b37b Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Tue, 30 Aug 2022 17:51:09 -0700 Subject: [PATCH 1/3] Theme: Add workaround for unsupported CSS4 selectors --- .../themes/wporg-main-2022/style.css | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/source/wp-content/themes/wporg-main-2022/style.css b/source/wp-content/themes/wporg-main-2022/style.css index f6b13235..dac71a15 100644 --- a/source/wp-content/themes/wporg-main-2022/style.css +++ b/source/wp-content/themes/wporg-main-2022/style.css @@ -227,3 +227,34 @@ 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. + */ +.wp-block-group[class*="wp-container-"], +.wp-block-columns[class*="wp-container-"], +.wp-block-group[class*="wp-container-"] > *, +.wp-block-columns[class*="wp-container-"] > *, +[class*="wp-container-"] .wp-block-buttons { + margin-left: auto !important; + margin-right: auto !important; +} + +.wp-block-group[class*="wp-container-"].entry-content, +.wp-block-group[class*="wp-container-"][class*="is-content-justification-"] > * { + margin-left: unset !important; + margin-right: unset !important; +} + +#benefits .wp-block-group[class*="wp-container-"], +#community .wp-block-group[class*="wp-container-"], +#editor .wp-block-group[class*="wp-container-"] { + max-width: 520px; +} From f30de437a7c66868c56b6117a46bce9a2d346eea Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Thu, 1 Sep 2022 11:16:53 -0700 Subject: [PATCH 2/3] Update workaround styles for Gutenberg 14 Co-Authored-By: Kelly Dwan --- .../themes/wporg-main-2022/style.css | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/source/wp-content/themes/wporg-main-2022/style.css b/source/wp-content/themes/wporg-main-2022/style.css index dac71a15..389114ad 100644 --- a/source/wp-content/themes/wporg-main-2022/style.css +++ b/source/wp-content/themes/wporg-main-2022/style.css @@ -238,23 +238,18 @@ * * Remove this when the above issue is fixed in a stable release. */ -.wp-block-group[class*="wp-container-"], -.wp-block-columns[class*="wp-container-"], -.wp-block-group[class*="wp-container-"] > *, -.wp-block-columns[class*="wp-container-"] > *, -[class*="wp-container-"] .wp-block-buttons { +body .is-layout-constrained > * { + max-width: var(--wp--style--global--content-size); margin-left: auto !important; margin-right: auto !important; } -.wp-block-group[class*="wp-container-"].entry-content, -.wp-block-group[class*="wp-container-"][class*="is-content-justification-"] > * { - margin-left: unset !important; - margin-right: unset !important; +body .is-layout-constrained > .alignwide { + max-width: var(--wp--style--global--wide-size); } -#benefits .wp-block-group[class*="wp-container-"], -#community .wp-block-group[class*="wp-container-"], -#editor .wp-block-group[class*="wp-container-"] { - max-width: 520px; +body .is-layout-constrained > .alignfull { + max-width: unset; + margin-left: unset !important; + margin-right: unset !important; } From 48f4cf5025eb4cb4c5e57c584a4d6a6e0a64a3dc Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Thu, 1 Sep 2022 11:28:30 -0700 Subject: [PATCH 3/3] Apply coding standards --- source/wp-content/themes/wporg-main-2022/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/source/wp-content/themes/wporg-main-2022/style.css b/source/wp-content/themes/wporg-main-2022/style.css index 389114ad..e4e337ca 100644 --- a/source/wp-content/themes/wporg-main-2022/style.css +++ b/source/wp-content/themes/wporg-main-2022/style.css @@ -238,6 +238,7 @@ * * 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;