GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.05k forks source link

QUESTION: Wrapper styling #3287

Closed RaresVlaiduc closed 3 years ago

RaresVlaiduc commented 3 years ago

First of all, congrats @artf for this amazing project 💯

I am currently working on a project and I wanted to ask if I can edit the wrapper (body) like I edit other components inside it. For example I would like to edit the padding of the wrapper as I do with the background-color.

grapesjs-question

I've had a look over the configs but couldn't find anything helpful.

Thank you!

LE: I have found a way. I am overwritting the stylable array from getWrapper() but I'm not 100% sure this is the correct way. Can you confirm this?

artf commented 3 years ago

LE: I have found a way. I am overwritting the stylable array from getWrapper() but I'm not 100% sure this is the correct way. Can you confirm this?

Yeah sure it's ok, but if you need, you can change the wrapper properties on init via mainConfig.domComponents.wrapper option https://github.com/artf/grapesjs/blob/18b2f95b7f844578dc2b28d786b126013d155d9e/src/dom_components/config/config.js#L9

kuhelbeher commented 3 years ago

you can change the wrapper properties on init via mainConfig.domComponents.wrapper option https://github.com/artf/grapesjs/blob/18b2f95b7f844578dc2b28d786b126013d155d9e/src/dom_components/config/config.js#L9

Hello, I've noticed that this options is for old version of grapesjs, but in new version wrapper property is removed from domComponents config. Is there a way to set some wrapper properties on initialization in new version?

artf commented 3 years ago

Yes @kuhelbeher, now the wrapper is created post plugins, so you can entirely extend it as any other component