Issue #1058πŸ’¬ AnsweredOpened Apr 21, 2018by tommedema1 reactions

CSS parser invalidly parses certain duplicate declarations

Quick answerby artf❀ 1

when the browser itself already has a DOM tree and all styling information etc can be retrieved on-demand once a component is selected Probably this is something I've tried to build before grapesjs, and to be honest, after few weeks of work I realized that the result was just a big, unmaintainable, unreliable, SLOW, p...

Read full answer below ↓

Question

Tested on latest dev branch commit 39be1e0. This problem occurred on one of my templates, so it's a real world issue. It took me about half a day to create this minified test case, so I hope it helps. If you have a template with the following CSS: A browser renders this correctly as such: <img width="609" alt="screen shot 2018-04-20 at 3 14 01 pm" src="https://user-images.githubusercontent.com/331833/39075971-8307bb60-44ad-11e8-89ed-355801ac3c33.png"> JSFiddle: https://jsfiddle.net/szLp8h4n/192/ But grapes renders it incorrectly: <img width="863" alt="screen shot 2018-04-20 at 3 16 04 pm" src...

Answers (3)

artfβ€’ Apr 22, 2018

when the browser itself already has a DOM tree and all styling information etc can be retrieved on-demand once a component is selected Probably this is something I've tried to build before grapesjs, and to be honest, after few weeks of work I realized that the result was just a big, unmaintainable,...

tommedemaβ€’ Apr 22, 2018

@artf it's surprising to me that this is slower because I thought the browser would be heavily optimized for this, but you definitely have more experience with this project so I'll trust in your judgement ;) I'm definitely in favor of an option to just add all rules unconditionally. This makes sens...

artfβ€’ Apr 25, 2018

I'd really appreciate a PR. I think the check would be ok inside the add method

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.