Skip to content

Commit

Permalink
Add comment to explain front-end-only selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Feb 14, 2023
1 parent c2c5d2a commit 1134fe7
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -664,6 +664,10 @@ export const toStyles = (
}

if ( useRootPaddingAlign ) {
/*
* These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508
* almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.
*/
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
.has-global-padding :where(.has-global-padding) { padding-right: 0; padding-left: 0; }
Expand Down

0 comments on commit 1134fe7

Please sign in to comment.