Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Inconsistent behavior when working with default styles #394

Open
jonschr opened this issue Jul 16, 2020 · 0 comments
Open

Inconsistent behavior when working with default styles #394

jonschr opened this issue Jul 16, 2020 · 0 comments

Comments

@jonschr
Copy link

jonschr commented Jul 16, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant