Opened 8 months ago
Last modified 2 months ago
#60408 new defect (bug)
Twenty Nineteen: Theme block styles are not applied to blocks in the widget area
Reported by: | poena | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | Bundled Theme | Keywords: | needs-patch needs-testing |
Focuses: | css | Cc: |
Description
Twenty Nineteen adds extra styling for some blocks, but on the front, the styles use
the class names .entry .entry-content
as part of the selector:
.entry .entry-content .wp-block-button .wp-block-button__link:not(.has-background) { background-color: #0073aa; }
So the styles are applied in the post content area, but not applied to blocks placed in the widget area.
The blocks in the widget area on the front does not match what is in the widget admin screen.
Attachments (4)
Change History (9)
#2
@
5 months ago
- Focuses css added
- Milestone changed from Awaiting Review to Future Release
- Version set to 5.8
#3
@
3 months ago
- Keywords needs-testing added
Adding the keyword to get testing on this, thank you.
#4
@
2 months ago
@sabernhardt @karmatosed Hi!
In your opinion, what would be the preferred solution for making sure that the theme block styles are applied to blocks in the widget area, not only the post content?
- Apply the styles by adding a selector with
.widget-area
- Removing
.entry .entry-content
selector
Relevant files:
https://core.trac.wordpress.org/browser/branches/6.6/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss#L127
#5
@
2 months ago
I have not tried to implement any of these, but I can share my preferences for the concepts.
- If
.entry .entry-content
can be removed without changing the post content's appearance, that would be my preference. However, those styles may need a higher specificity to override something. - If the selectors need higher specificity but one class is enough, I would suggest replacing
.entry .entry-content
with.site
. The color patterns function uses.entry .button
(without.entry-content
), which suggests that that needed one extra class to override a selector. - If it needs two class-level selectors,
:root .site
might work. - Hopefully the stylesheet would not need to copy all of those selectors with a
.widget-area
variation.
The button block in the widget area, on the front of the site