Issue #3693πŸ’¬ AnsweredOpened Aug 11, 2021by GaikwadShubham1 reactions

AdoptStylesheet not supported in grapesJS

Quick answerby artf❀ 1

This issue is due to how AdoptStylesheet works and it's similar to this one from lit-element. Basically, you can't share the same CSSStyleSheet across multiple documents, so you have to recreate it manually, here below is a code for custom elements, in order to support adoptedStyleSheets.

Read full answer below ↓

Question

Version: You can get the version by typing grapesjs.version into the console 0.17.22 Are you able to reproduce the bug from the demo?[x] Yes[ ] No What is the expected behavior? Should be able to see the web component in similar fashion as it is outside the grapesJS container Describe the bug detailed Grapesjs not able render the css from constructable stylesheet. What is the current behavior? Able to load the component without styling Are you able to attach screenshots, screencasts or a live demo?[x] Yes (https://codesandbox.io/embed/frosty-payne-3fhd7?fontsize=14&hidenavigation=1&theme=dark...

Answers (3)

artfβ€’ Aug 11, 2021

This issue is due to how AdoptStylesheet works and it's similar to this one from lit-element. Basically, you can't share the same CSSStyleSheet across multiple documents, so you have to recreate it manually, here below is a code for custom elements, in order to support adoptedStyleSheets.

vasicvukβ€’ Dec 28, 2023

Is there any solution for using lit-element components 3.X with grapesJS?

GJSBlockβ€’ May 17, 2026

Thanks for reporting this, @GaikwadShubham. The issue with AdoptStylesheet not supported in grapesJS 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:...

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.