Section Background CSS Specificity
-
The inline CSS generated for Section background is not specific/localized enough to just the Section it’s supposed to applied to. For example, if I have a Section nested in another Section, and the parent section has a background, the CSS cascades down to the child Section because the selector is
.parent-section-id .grids-s-w_i:before
rather than only selecting the very next .grids-s-w selector.I resolved this by adding a
>
in between the two css classes in /src/Core/Blocks/Section.php line 231, like$style .= sprintf( '%s > .grids-s-w_i:before {', esc_attr( $selector ) );
Not sure if this is a breaking change elsewhere, but worth considering adding to your next version as I’ve patched it locally.
- The topic ‘Section Background CSS Specificity’ is closed to new replies.