Issue #1513💬 AnsweredOpened October 14, 2018by yomeshgupta0 reactions

Duplicate CSS written under media queries

Quick answerby yomeshgupta

GrapeJs Editor Initialization Test Block Added Output @artf I am trying to add a custom block and providing HTML/CSS of the block via content attribute. When I drop the block onto the canvas then Media Query CSS is added twice to DOM Element with class gjs-css-rules-480px . It only happens if I provide CSS via content...

Read full answer below ↓

Question

Hey @artf Great work on the project! I noticed something and I am able to reproduce it on my local machine too. Any css written under media queries is being duplicated/applied twice.

Grapesjs Version - 0.14.33 Browser - Version 69.0.3497.100 (Official Build) (64-bit) OS - Windows 10 Demo - https://grapesjs.com/demo.html

grapejs_1

Answers (3)

yomeshguptaOctober 19, 2018

GrapeJs Editor Initialization Test Block Added Output @artf I am trying to add a custom block and providing HTML/CSS of the block via content attribute. When I drop the block onto the canvas then Media Query CSS is added twice to DOM Element with class gjs-css-rules-480px . It only happens if I pro...

yomeshguptaOctober 19, 2018

Link to GrapeJS I am fetching - https://grapesjs.com/js/grapes.min.js?v0.14.33 In my debugging (might be wrong), in the file : ./src/css_composer/index.js When a rule is added The rule is matched against existing rules, if not present then added else updated. Somehow, in the compare function it is...

artfOctober 26, 2018

Thanks Yomesh, I'm investigating on this

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.