studiopress / atomic-blocks

Atomic Blocks has been renamed to Genesis Blocks. This plugin is no longer maintained! Visit Atomic Blocks → Migrate to migrate to the new plugin.
https://wordpress.org/plugins/genesis-blocks/
GNU General Public License v3.0
157 stars 57 forks source link

Inconsistent behavior when working with default styles #394

Open jonschr opened 4 years ago

jonschr commented 4 years ago

So, I'd like to add some default styles for AB containers (just to speed up adding sections on sites). This works pretty well, and here's the scss I'm using, which affects the backend and frontend and mostly works fine (I'm sure it can be improved):

https://gist.github.com/jonschr/6644f72c4fe1079bfe60a378f3a07708

All it does it set padding and max innerwidth defaults, on both frontend and backend, for a fullwidth container block when that container block is not nested within anything.

Here's the issue I run into: on both the frontend and backend of the site, updating the padding values overrides my styles here. Perfect! Except when the padding is set to 0px on any side. If I set the padding to top 20%, bottom 0%, left 10%, right 10% using the Gutenberg UI, then the markup on the frontend only outputs the top, left, and right values – when the value is 0, it doesn't output at all.

And that's actually the key here. An empty selection shouldn't be treated the same as 0% (not outputting anything). Empty means "default," not "0."

In short, my question is whether that's a change you'd consider making.

Video to explain in case this explanation isn't clear: https://www.loom.com/share/aa00508c2fda4865acf92a0250e1c4ed