-
Notifications
You must be signed in to change notification settings - Fork 362
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
Blockbase: Fix previewing post editor colors from style variations in child themes #8575
base: trunk
Are you sure you want to change the base?
Conversation
Preview changesI've detected changes to the following themes in this PR: Blockbase. I will update this comment with the latest preview links as you push more changes to this PR. Note The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions. |
2987277
to
36e25fc
Compare
… child themes Fixes #6963
36e25fc
to
46a9a12
Compare
Theme-Check resultsblockbase: No changes required ✅.💡 RECOMMENDED (1)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes fix the issue described in #6963 for me, and I agree with this reasoning:
Lowering the specificity of these rules allows the correct color presets generated from the style variation to be used, as expected.
LGTM 👍
Fixes #6963
Changes proposed in this Pull Request:
This PR removes the
!important
from the fallback color rules in the Blockbase stylesheet. The actual colors are defined in theme.json and generated in global styles, and these!important
fallbacks cause problems in child themes with style variations loaded, when previewing colors in the post editor. The issue was raised referencing the Attar theme, but it is reproducible with other Blockbase child themes, like Ames.Please note that these rules do not cause the same issues when the Blockbase theme itself is activated, or in the site editor, or on the frontend.
With a child theme like Attar activated and a style variation selected, the Blockbase theme styles are inlined in the post editor document after the style variation styles, overriding them and causing the color to be set to the Blockbase theme default custom colors:
Lowering the specificity of these rules allows the correct color presets generated from the style variation to be used, as expected.
An alternative fix could be to adjust the loading order, so that the Blockbase stylesheet is inlined before the global styles. I'm not aware of this happening with other non Blockbase themes however.
Screenshots (Theme: Attar, Style variation: Charcoal)
Testing
We need to test both the Blockbase theme and child themes.
Further regression testing: