Issue #5207πŸ’¬ AnsweredOpened Jun 28, 2023by gxanshu1 reactions

Duplicated CSS while multi page creation

Quick answerby artf❀ 1

This is intentional and I'm not planning to change this behaviour as you can easily create specific CSS selectors if you need different styles per page. The big benefit of this approach is to allow reusing selectors across pages.

Read full answer below ↓

Question

GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome latest Reproducible demo link https://codesandbox.io/s/withered-bush-wv29dx?file=/index.js Describe the bug How to reproduce the bug?... create multi pages in grapesjs.init()... check the styles of each page What is the expected behavior? every page contains there own style not include the CSS of other pages ... What is the current behavior? currently the CSS of all pages will merged and apply on all pages. for more details visit the reproduction link and check the code of all pages ... If...

Answers (3)

artfβ€’ Jul 4, 2023

This is intentional and I'm not planning to change this behaviour as you can easily create specific CSS selectors if you need different styles per page. The big benefit of this approach is to allow reusing selectors across pages.

hasan-aaβ€’ Sep 11, 2024

I think I'm experiencing an issue with this approach. I'm saving the pages to server like this: and loading them like this in a loop: The css rules targeting ids are working fine, but the rules with a class are duplicating even when loaded in separate pages. For instance the # of css rules for .gjs...

GJS Helperβ€’ May 17, 2026

The issue you're encountering with duplicated CSS across multiple pages in GrapesJS is a common point of confusion related to how GrapesJS manages styles globally within an editor instance. By default, GrapesJS's CssComposer (the component responsible for managing all CSS rules) accumulates styles....

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.