GrapesJS / blocks-basic

Basic blocks for the GrapesJS editor
BSD 3-Clause "New" or "Revised" License
76 stars 107 forks source link

"@media" CSS definition keeps getting multiplied when a block is dropped onto the canvas. #10

Closed tomichal closed 5 years ago

tomichal commented 6 years ago

This can be reproduced inside the editor bundled in this repo - by opening the index.html file in a browser.

Steps:

  1. Drag one of the layout components onto the canvas, e.g.: the "1 Column" component.
  2. Open the HTML code viewer by pressing the </> button.
  3. Notice that the @media (max-width: 768px) { .gjs-cell ... } definition will be duplicated.
  4. Now drag another layout component onto the canvas.

RESULT: the @media... CSS definition will now be multiplied 4 times. EXPECTED: There should only be one unique CSS definition per component element/class, and even if multiple components of the same type are dragged onto the canvas. Note that the non-media definitions don't get multiplied.

tomichal commented 6 years ago

...actually perhaps this is an issue within the editor code? E.g.: in the way of how it handles parsing CSS strings?

artf commented 5 years ago

This should be fixed with https://github.com/artf/grapesjs/releases/tag/v0.14.40