Issue #3070πŸ’¬ AnsweredOpened October 9, 2020by mhowey2 reactions

BUG / Feature? Applying background color to body component isn't part of the exported HTML.

Quick answerby JoshLucio❀ 1

@mhowey I have seen this also, but I always assumed that the body is just the placeholder canvas for the content. Changes to the body do not export since the content placed in the body is the only thing being exported. In my application use, the body color change is used just to visualize what the content will look li...

Read full answer below ↓

Question

Hi Art, thanks for creating such a fantastic project! I'm not sure if this would be considered a bug or feature request...but I'm having issues deciding how to hande the background color on the body while using the newsletter plugin with GrapesJS. Steps to Reproduce:Select the body (root element) in the canvas.In the style palette under "decorations" >> "Background" -- select a color to fill the body withClick export HTML, only the children elements are provided, so when the output HTML is used, it has no wrapper to apply the background color with. If there is a way to handle this correctly t...

Answers (3)

JoshLucioβ€’ October 9, 2020

@mhowey I have seen this also, but I always assumed that the body is just the placeholder canvas for the content. Changes to the body do not export since the content placed in the body is the only thing being exported. In my application use, the body color change is used just to visualize what the...

artfβ€’ October 11, 2020

You can use this option

grapesjs.init({
 exportWrapper: true,
})
mhoweyβ€’ October 9, 2020

Thanks for the reply @JoshLucio . I'm using the newsletter preset plugin, which I believe is more targeted toward HTML email, rather than site building. I was actually thinking what you said to be the case, and I've explored all the getWrapper and getWrapperEl methods that Grapes provides, but they...

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.