CSS parser invalidly parses certain duplicate declarations
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)
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,...
@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...
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.
Issue #4765
The documented way to parse @keyframes does not work
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v107Describe the bug How to reproduce...
Issue #5618
Old Component script is not deleted on Import. Resulting in duplicate scripts
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Edge v120.0.2210.121 Reproducible demo lin...
Issue #896
Media query rules are overridden by class rules in canvas
Hi @artf , I've noticed an issue while testing one of my templates using different device configurations that supposed to trigger media que...
Issue #4434
CSS Parser's shape doesn't allow the CSS property to be defined more than once.
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? AnyReproducible demo link https://grapesjs.c...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.