Issue #1032πŸ’¬ AnsweredOpened April 12, 2018by tommedema2 reactions

Multiple font-face at-rule CSS rules are not processed

Quick answerby tommedema❀ 1

@cjpollard thanks, but it seems like you are taking apart something that was stitched together for the wrong reason. I believe a better approach is to not stitch together these at-rules in the first place. @artf I have submitted a PR for this: https://github.com/artf/grapesjs/pull/1036 To be honest, in my opinion the...

Read full answer below ↓

Question

Latest version of grapes #cfde1c1 If you supply a single @font-face, this is parsed just fine: JSFiddle example: https://jsfiddle.net/szLp8h4n/140/ Screenshot: <img width="1395" alt="screen shot 2018-04-11 at 3 19 56 pm" src="https://user-images.githubusercontent.com/331833/38646200-d5c4260e-3d9b-11e8-8c41-7c3c6b1f67dd.png"> However, if you supply a second @font-face, only the second one is parsed, and the first is lost: JSFiddle example: https://jsfiddle.net/szLp8h4n/141/ Screenshot: <img width="1401" alt="screen shot 2018-04-11 at 3 21 45 pm" src="https://user-images.githubusercontent.com/3...

Answers (3)

tommedemaβ€’ April 12, 2018

@cjpollard thanks, but it seems like you are taking apart something that was stitched together for the wrong reason. I believe a better approach is to not stitch together these at-rules in the first place. @artf I have submitted a PR for this: https://github.com/artf/grapesjs/pull/1036 To be honest...

artfβ€’ April 13, 2018

Totally agree with you Tom, the main goal of cssComposer is just to provide a lean interface for style definitions. What we have inside CssParser right now it's actually a browser's parser and the rest of code is just a traverser. Actually, we have issues like #307 which show the inconsistency gene...

tommedemaβ€’ April 12, 2018

@artf FYI I can now reproduce this in a failing test case: After further debugging this seems to be caused by cssComposer thinking that the second rule is the same rule as the previous one and then returning the first rule: https://github.com/artf/grapesjs/blob/dev/src/css_composer/index.js#L185

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.