Fórumok

Minify problem with Google Fonts

Jesse Paria, módosítva 12 év-val korábban

Minify problem with Google Fonts

Junior Member Bejegyzések: 69 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
Hello,

I am adding google fonts to one of the themes that I am developing. I added the fonts through the @font-face css selector
@import url(http://fonts.googleapis.com/css?family=Nobile:400,700);


Everything works fine until minification is turned on and then evidently the URL is changed and the server can no longer find the resource. It seems to throw a 500 internal error. The server looks in the theme/css folder for it instead of looking for an external resources. From the error, it seems that minifier is removing one of the "/" from the HTTP://

You can see part of the error below
css/http:/fonts.googleapis.com/css?family=Nobile:400,700 (No such file or directory)


I am sure I could probably load the resources with Javascript but that just doesn't seem "clean" as then you are using javascript to deal with styling. This is what css is for.

Has anyone run into this same problem?

Thanks in advance
Jesse Paria, módosítva 12 év-val korábban

RE: Minify problem with Google Fonts (Válasz)

Junior Member Bejegyzések: 69 Csatlakozás dátuma: 2011.03.04. Legújabb bejegyzések
An update: I found no way around this error. The minify for some reason would rewrite the css so that it was looking for the file in the CSS folder instead of through HTTP

The only way I could fix this is by adding the link through the <link href="http://fonts.googleapis.com/css?family=Nobile:400,700"> into the template_normal.vm or by adding it via javascript.

Hope this save people time! Anyone else have a css based solution I would love to hear it.
thumbnail
Joerg Viola, módosítva 11 év-val korábban

RE: Minify problem with Google Fonts

New Member Bejegyzések: 3 Csatlakozás dátuma: 2013.02.27. Legújabb bejegyzések
Confirmed. Same happens here!