Skip to content
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

Remove margins from empty block widgets #609

Open
gabbsmo opened this issue May 9, 2024 · 0 comments
Open

Remove margins from empty block widgets #609

gabbsmo opened this issue May 9, 2024 · 0 comments
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review

Comments

@gabbsmo
Copy link

gabbsmo commented May 9, 2024

Description

I am conditionally displaying widgets. In my case it is per language, using WPML. According to them, plugin developers cannot fully remove all markup for block widgets and will leave an empty widget container.

I belive there are other plugins that allows for conditionally showing or hiding widgets that would have the same issue

My suggestion is that the margins that are added to widgets by the theme should not be applied if the widget is :empty.

To clarify, this is only a problem with the modern block widgets. Classic widgets are fine.


References

Example markup of empty block widget: <aside id="block-2" class="widget inner-padding widget_block"></aside>
WPML ticket: https://wpml.org/forums/topic/a-empty-div-element-are-rendered-for-widgets-that-are-disabled-for-language/

@gabbsmo gabbsmo added the feature Features, refactoring, enhancements, improvements label May 9, 2024
@github-actions github-actions bot added the triage Awaiting review label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features, refactoring, enhancements, improvements triage Awaiting review
Projects
None yet
Development

No branches or pull requests

1 participant