Issue #5810πŸ’¬ AnsweredOpened Apr 14, 2024by ctrhub1 reactions

Unnecessary Canvas style

Quick answerby artf❀ 1

it is intended to store canvas styles, styles that do not affect the result of hmtl/css, styles that will not be exported, right? Correctby default the body has a white background, this seems to be the default color in all browsers, no? yeah but the iframe body doesn't have any default background color that's why that...

Read full answer below ↓

Question

GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Arc Version 1.35.0 / Chromium Engine 123.0Reproducible demo link https://grapesjs.com/demo.htmlDescribe the bug My special case: In my case, all styles from plugins and general styles are located in the header. So, to achieve similar behavior in the editor, I add these styles to the Canvas head. And when I specify the background color in my general styles, it is overridden by the GJS Canvas styles. This obliges me to specify the rule, which I don't want to do. I'm guessing this shouldn't be a rare c...

Answers (4)

artfβ€’ Apr 17, 2024

it is intended to store canvas styles, styles that do not affect the result of hmtl/css, styles that will not be exported, right? Correctby default the body has a white background, this seems to be the default color in all browsers, no? yeah but the iframe body doesn't have any default background c...

artfβ€’ Apr 15, 2024

There is canvasCss option for that.

Next time open a Discussion please, as this is not a core bug but wrong usage.

ctrhubβ€’ Apr 16, 2024

Hey @artf. Thanks for the answer. I'm not sure that we understood each other and I would like to clarify one detail. Yes, I know about the canvasCss property, moreover, I use it to change the styles of the selected component. I understand the essence of the property: it is intended to store canvas...

GJS Helperβ€’ May 17, 2026

The issue you're encountering stems from GrapesJS applying a default background-color: #fff; to the body element within the canvas iframe. This is a common practice in web builders to provide a consistent, neutral background for the editing area. When you inject your own body { background-color: bl...

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.