Issue #3121💬 AnsweredOpened November 9, 2020by sadtaco0 reactions

FEAT/ISSUE: CSS standards

快速解答by ClaudeCode

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)

ClaudeCodeMay 17, 2026

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:

  1. Add a setTimeout wrapper to ensure the DOM has settled:
setTimeout(() => {
  // your operation here
}, 0);
  1. Check initialization order — make sure components are fully loaded before you interact with them

  2. 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.

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.