fix: move editor ad block padding to Sass#2713
Open
faisalahammad wants to merge 1 commit into
Open
Conversation
Padding: 8px was conditionally applied in color-patterns.php only when custom ad background color was set. Moved to style-editor-base.scss so it always applies, matching front-end behavior. Fixes Automattic#1700
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The editor ad block had
padding: 8pxconditionally applied incolor-patterns.phponly when a custom ad background color was set. This made spacing inconsistent — padding was absent with default colors, present with custom colors. Moved it tostyle-editor-base.scssso it always applies, matching front-end behavior.Fixes #1700
Changes
newspack-theme/inc/color-patterns.php
Before:
After:
Why: Padding is a layout concern, not a color concern. Keeping it in the color-conditional block made editor spacing depend on customizer state.
newspack-theme/sass/style-editor-base.scss
Before:
After:
Why: Consolidates editor ad block styles in one location. Padding now applies unconditionally, consistent with how the front-end handles ad widget padding in
newspack-ads.scss.Testing
style-editor.css—.wp-block-newspack-ads-blocks-ad-unit > divshould containpadding:8pxcolor-patterns.php, the ad editor block should only outputbackground-color