Issue #986✓ SolvedOpened March 29, 2018by nojacko2 reactions

Exported CSS cannot override body's background-color

Quick answerby artf2

Thanks James, we already aware of it #552 but unfortunately not yet provided any fix :/ The main problem is that GrapesJS doesn't handle well body/wrapper styling and so, as a result, we have the body coming from 3 different spots:from protectedCss optionfrom the wrapper's component style (which usually is the body an...

Read full answer below ↓

Question

When a body background style is defined in the style option of the init function it's not possible to override. Given the style: After changing the background-color in Grapes, the CSS output is: Due to the ordering, the original colour will take precedence when used. While not necessarily an issue, the repetition of body isn't needed and would probably solve this issue if the body css definition was merged. I believe this happens with other CSS selectors too. Steps to reproducehttps://jsfiddle.net/jk3g2eu2/Click the wrapper in the canvasChange background color.Click the code icon to see gener...

Answers (2)

👍 Most helpfulartfMarch 31, 2018

Thanks James, we already aware of it #552 but unfortunately not yet provided any fix :/ The main problem is that GrapesJS doesn't handle well body/wrapper styling and so, as a result, we have the body coming from 3 different spots:from protectedCss optionfrom the wrapper's component style (which us...

lock[bot]September 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.