FEAT/ISSUE: CSS standards
Thanks for reporting this, @sadtaco. The issue with FEAT/ISSUE: CSS standards appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state. What to try: Add a setTimeout wrapper to ensure the DOM...
Read full answer below ↓Question
I'm going to say this is both a feature request as I get into some parts of it, but also a bit of an issue.
I would say it looks bad to have a project newer than 2015 that's using px for nearly everything. People are using screensizes that are only 768 pixels on the narrowest plane, whether mobile or desktop, to 2160p and beyond. "px" measurements are bad for this. A tool like this is made for non-technical people who aren't going to understand that something looking fine in px measurements on their screen will not look right on all screens. The most similar thing to GrapeJS is carrd.co right? There they actually just use arbitrary "size" measurements that they translate internally so the end user can't do dumb things.
My suggestion: Remove px in controls interface, and CSS for the styling of GrapeJS itself. Replace with vmax, rem and/or % where appropriate as the new defaults.
Yes there are drop downs for % and/or em and rem generally, but px is usually the default when it really shouldn't even be an option except for possibly being a configuration option that's disabled by default.
I'd also label this as a bug:
Default CSS for the editor panels is using z-index. This is something I also don't expect of something modern, as stacking order is a cleaner and more issue and edge-case free way of ordering what's on top. I found this out as I was working on custom controls and I'm having to overwrite CSS that shouldn't even exist.
The editor seems to display fine if you remove all the z-index css and place
<div class="gjs-pn-panel gjs-pn-views gjs-one-bg gjs-two-color"> as the bottom most element of those siblings
Answers (1)
Thanks for reporting this, @sadtaco.
The issue with FEAT/ISSUE: CSS standards appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state.
What to try:
- Add a setTimeout wrapper to ensure the DOM has settled:
setTimeout(() => {
// your operation here
}, 0);
-
Check initialization order — make sure components are fully loaded before you interact with them
-
Use the editor's event system — listen to completion events:
editor.on('component:mount', (component) => {
// safe to interact with component here
});
Recommended next steps:
- Test with the latest GrapesJS version if you haven't
- Provide a minimal reproducible example (CodeSandbox) — this helps the team identify the root cause faster
- Include GrapesJS version, browser, and console errors in your report
Related Questions and Answers
Continue research with similar issue discussions.
Issue #5089
Error importing codemirror library in SCSS
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Firefox 112.0.1 Reproducible demo link htt...
Issue #3561
FEAT: Enhanced Shadow DOM Support
What are you trying to add to GrapesJS? Better Shadow DOM support, allowing developers to render GrapesJS inside a Shadow element without h...
Issue #3216
FEAT: Add referrerPolicy to image loading through asset manager
What are you trying to add to GrapesJS? I'm trying to add the Referer header to image loading through asset manager. Describe your feature...
Issue #3525
FEAT: In Style Manager, Allow Requiring the Default Setting
What are you trying to add to GrapesJS? The CSS property float only makes sense for position: static; elements, which happens to be the def...
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.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.