Skip to content
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

Theme: Add workaround for unsupported CSS4 selectors #111

Merged
merged 4 commits into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}