Exported CSS cannot override body's background-color
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)
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...
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.
Issue #914
[BUG]: Grapes cannot be reinitiated with new HTML
Calling init() on Grapes after changing HTML fails. This kinda situation happens on one page apps. I think a destory() function to graceful...
Issue #1033
[BUG]: When IDs are used, it's not possible to update or remove a style
Steps to reproducehttps://jsfiddle.net/1cjjr02p/Click the text in editor, change background colour.Export CSS. You'll see both new and orig...
Issue #1425
Properties Validate of elements
@Arif How can we validate the properties for the grapejs element like background color We have given an option for manual background entry...
Issue #1877
[FEATURE REQUEST] Custom styles that add/remove custom classes?
Currently, all the style manager values that you change for an element simply update a <style> tag inline in the HTML. Is it possible to ch...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.