Skip to content

Commit

Permalink
Lowered specificity of alignment rules (#38947)
Browse files Browse the repository at this point in the history
* lowered specificity of alignment rules

* apply the same fix to the editor

* linting
  • Loading branch information
MaggieCabrera authored Feb 21, 2022
1 parent 40aca04 commit 1b02fb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support

$style = '';
if ( $content_size || $wide_size ) {
$style = "$selector > :not(.alignleft):not(.alignright) {";
$style = "$selector > :where(:not(.alignleft):not(.alignright)) {";
$style .= 'max-width: ' . esc_html( $all_max_width_value ) . ';';
$style .= 'margin-left: auto !important;';
$style .= 'margin-right: auto !important;';
Expand Down
5 changes: 4 additions & 1 deletion packages/block-editor/src/layouts/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export default {
let output =
!! contentSize || !! wideSize
? `
${ appendSelectors( selector, '> :not(.alignleft):not(.alignright)' ) } {
${ appendSelectors(
selector,
'> :where(:not(.alignleft):not(.alignright))'
) } {
max-width: ${ contentSize ?? wideSize };
margin-left: auto !important;
margin-right: auto !important;
Expand Down

0 comments on commit 1b02fb4

Please sign in to comment.