-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Multiple font-face at-rule CSS rules are not processed #1032
Comments
@artf FYI I can now reproduce this in a failing test case:
After further debugging this seems to be caused by https://github.com/artf/grapesjs/blob/dev/src/css_composer/index.js#L185 |
I managed to fix this in my fork here. Not sure if this is the best way of doing it, but I can submit a pull request if desired. |
@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: To be honest, in my opinion the parsers should not try to be smart and optimize code. The browser is a parser itself, and if the rules are found in the browser, grapes should honor this. By making the parser complicated we introduce several bugs (I myself have gathered a list already). In fact I'd recommend not having a parser at all and just getting components and their styles etc. in real time from the DOM / Javascript API. |
Totally agree with you Tom, the main goal of BTW thank you for such a quick solution |
@artf I see, but then you probably shouldn't do things like removing empty tags or concatenating the same rules; that's extending your "traverser" with parser capabilities ;) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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:
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:
I am trying to debug this but would appreciate your help. Could it be related to line 122 in ParserCss.js?
The text was updated successfully, but these errors were encountered: