GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
629 stars 226 forks source link

Defaults not being set in style manager when dropping blocks #190

Closed rcloss closed 4 years ago

rcloss commented 4 years ago

When you drop a block like mj-image or mj-column there are default paddings that are applied but aren't reflected in the Style manager in the sidebar, this makes it confusing for a user who clicks on an image or a column and sees that the padding is 0 even though it's 10px (for example), it still works for editing, for now I'm updating things when you drop a block so that it displays properly but I have to go through every block and make check every setting to make sure the defaults are set which is irritating to manage

DRoet commented 4 years ago

Are you seeing this on the latest version (0.1.18)?

rcloss commented 4 years ago

Nope! Thanks that fixed it

rcloss commented 4 years ago

small update, mj-button is missing the padding-top default style for some reason

DRoet commented 4 years ago

Hmm I think thats by design, since the the default styling doesn't apply a top padding:

'padding-bottom': '10px',
'padding-right': '25px',
'padding-left': '25px',

https://github.com/artf/grapesjs-mjml/blob/master/src/components/Button.js#L33

rcloss commented 4 years ago

Those might be the defaults but if you drop a button it has 10px of padding on top that can be changed, but it's showing 0px on the sidebar. So there's a disconnect somewhere

DRoet commented 4 years ago

You are right, mjml applies padding: 10px 25px to the buttons by default so we should reflect that on our end.

released in v0.1.19