Skip to content
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

SVG file path referenced with url() in package CSS file not parsed correctly. #5069

Closed
carlosbaraza opened this issue Aug 30, 2015 · 3 comments

Comments

@carlosbaraza
Copy link
Contributor

Today I experimented an issue with a package, which is serving a SVG file, referenced relatively via url() in a CSS file.

The issue is that the SVG file url is not parsed and overridden with the correct packages/package/... during the CSS compilation time. However, the PNG file referenced in the same way is correctly parsed. The result is that the file could not be found, so the icons are not displayed correctly.

With SVG file rule enabled:
image

With SVG file rule disabled:
screen shot 2015-08-30 at 12 13 30

Concretely, we could appreciate that the CSS definition is similar in the file that should have been parsed correctly:
https://github.com/dimsemenov/PhotoSwipe/blob/master/dist/default-skin/default-skin.css#L55
https://github.com/dimsemenov/PhotoSwipe/blob/master/dist/default-skin/default-skin.css#L65

Finally, in order to ease the reproduction of the issue, I pushed a simple meteor app that illustrates the issue: https://github.com/carlosbaraza/meteor-css-url-parse-svg

@stubailo
Copy link
Contributor

stubailo commented Sep 1, 2015

@carlosbaraza I figured it out - it actually doesn't have anything to do with SVG vs. PNG. It's actually because one of the rules is inside a media query, and we don't correctly traverse the syntax tree inside media queries.

Hopefully I can push a fix soon and get it into 1.2.

@stubailo
Copy link
Contributor

stubailo commented Sep 1, 2015

Oh - great news. I just ran it with Meteor 1.2 and everything works.

Try upgrading your app to the release candidate and let me know:

meteor update --release 1.2-rc.10

@stubailo stubailo closed this as completed Sep 1, 2015
@carlosbaraza
Copy link
Contributor Author

Hi @stubailo,

Great news! I will have a look as soon as I have some time. For the moment, my workaround is to actually serve the file on that path (file in public folder). I am not in a rush, so I will wait for the official 1.2 release.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants