When using regenerate CSS it re-adds default values where it finds blank fields.
Can be reproduced like this:
- Add a section and remove it’s default value (padding, width etc.)
- use regenerate css;
- the default values should be back for that section.
Also observed it on images for which I removed their preset size values. Their size (auto, 100%) was back after regenerate.
I noticed this when I have updated from a previous version that didn’t had regenerate. (may not behave the same of a new install)
Thanks for bringing this up @alex.
This is one point where Gutenberg is quite difficult to deal with, will look into it.
I can’t seem to reproduce this on my side…
May I ask how you are removing the values for the properties?
Could you possibly try reloading the cache for the settings page?
I think this issue was the case just when upgrading from a pre 1.1.2 version.
On newer version seems to be ok.
Regarding removing values, I mean simple deleting them on a specific element. (for example for a Section removing the default 150px values and leaving it empty)
Note that this is still happening. (but it’s hard to replicate)
Maybe this should be the default behavior (like in case the values are removed from an element that has global settings, the defaults should take place), but in that case, should behave the same all the time. (and also be visible in the builder)
As currently if a Section, let’s say initially has this values (inherited from the globals):
If I remove them all, in the builder and on the frontend it appears, as expected:
But after a plugin update, a regeneration of the css/html or an update on a page (I don’t know what is exactly the trigger as it happens randomly), the section is back to :
So currently, the safe way to this issue is to simply add values instead of leaving the element empty, like this:
Thanks for keeping this up to date. I’m sorry for the trouble here.
Indeed, setting to 0 is not a solution since it adds bulk to CSS and requires an extra step from the user.
I think I might see where this is coming from, and why you are experiencing this issue on a page save/regeneration.
Please bear with me while we look into this a bit further, and thanks for your patience!
Hi there @alex!
Are you still experiencing any trouble with this?
Hi, Nope seems to be ok after the last updates!