Forums
Forums / Theme: GeneratePress / Hungry CSS in sidebar
(@codeamp)
3 years, 10 months ago
Hi there
I’m developing a plugin (using blocks) and am testing with popular themes (including yours, naturally!) and I think I’ve found a CSS issue.
Essentially, your CSS (when adding a block widget to the sidebar) is removing margin-bottom from some of our internal containers.
margin-bottom
Take a block with markup like:
<div> <h3>Hello World</h3> </div>
The css is removing the margin bottom from from the <h3>.
<h3>
The rule I see being applied from main.css is:
main.css
.sidebar .widget *:last-child, .footer-widgets .widget *:last-child { margin-bottom: 0; }
This effectively targets any last-child, in any container no matter how nested it is, in the sidebar/widget.
last-child
My guess is it should only target the last child that is a direct descendant of .widget:
.widget
.sidebar .widget > *:last-child, .footer-widgets .widget > *:last-child { margin-bottom: 0; }
Thanks
(@diggeddy)
Hi there,
yeah its legacy CSS, which although is something we would like to change, its a difficult change to make as it may adversely affect many sites.
But its on our radar, and something we may address in a future.
If you would like to raise an Issue on our GitHub then we can keep a track of it:
https://github.com/tomusborne/generatepress/issues
The topic ‘Hungry CSS in sidebar’ is closed to new replies.