Jump to content

Bug in CCC when optimizing @import sentences


Recommended Posts

Hi, I using PS 1.5.4.0 and I think there is a bug in CCC handling of @import CSS sentences.

 

I my case, a CSS file linked prior optimizing with CCC has:

...
@charset "utf-8";
/* CSS Document */


/* --------------------------------------------

   TYPOGRAPHY

-------------------------------------------- */

@import url("http://fonts.googleapis.com/css?family=Germania+One|Noto+Sans:400,400italic,700,700italic");
...

 

But the resulting optimized file, *_all.css has:

@import url("http://www.d-diferentes.com/themes/dd/css/grid_prestashop.css");@import url("http://www.d-diferentes.com/modules/parchedd/views/css/http://fonts.googleapis.com/css?family=Germania+One|Noto+Sans:400,400italic,700,700italic");
...

 

Where "

http://www.d-diferentes.com/modules/parchedd/views/css/

" should not be and it is the URL of the original CSS file (in a module).

 

Someone know what should be fixed, and how, to prevent that incorrect optimized @import url?

 

TIA, Antonio.

Link to comment
Share on other sites

HI, thnx for your advise

try to put the code of this url

 

http://fonts.googlea...c,700,700italic

 

into the css

 

But bad news, @font-face have also the bad URL prefix (http://www.d-diferentes.com/modules/parchedd/views/css/ that is where the css file is really located), i.e. (fragment of optimized css follows):

@font-face{font-family:'Germania One';font-style:normal;font-weight:400;src:local('Germania One'),local('GermaniaOne-Regular'),url(http://www.d-diferentes.com/modules/parchedd/views/css/http://themes.googleusercontent.com/static/fonts/germaniaone/v1/3_6AyUql_-FbDi1e68jHdHhCUOGz7vYGh680lGh-uXM.woff) format('woff')}

 

Also, a CCC bug fix would prefered, as your code makes 4 call to Google, insted the @import method, which only makes 1.

 

Please, futher help is requested, preferably a CCC fix.

 

TIA, Antonio.

Link to comment
Share on other sites

  • 4 months later...

HI, thnx for your advise

 

 

But bad news, @font-face have also the bad URL prefix (http://www.d-diferentes.com/modules/parchedd/views/css/ that is where the css file is really located), i.e. (fragment of optimized css follows):

@font-face{font-family:'Germania One';font-style:normal;font-weight:400;src:local('Germania One'),local('GermaniaOne-Regular'),url(http://www.d-diferentes.com/modules/parchedd/views/css/http://themes.googleusercontent.com/static/fonts/germaniaone/v1/3_6AyUql_-FbDi1e68jHdHhCUOGz7vYGh680lGh-uXM.woff) format('woff')}
Also, a CCC bug fix would prefered, as your code makes 4 call to Google, insted the @import method, which only makes 1.

 

Please, futher help is requested, preferably a CCC fix.

 

TIA, Antonio.

 

 

Hello,

 

I know that my reply is a bit outdated, but maybe it can solve sb's problems.

 

You got those errors because of bug in CCC, even if you paste Google Font source code (as @shaker mentioned) it still has HTTP URLs, which aren't well translated (even in when you wrap them into '**').

 

So, here's my workaround:

 

1. Paste the code from Google into some editor

2. Copy links from URL, download these WOFF files to your server into /themes/(yourtheme)/css directory

3. Change the CSS code (i.e. global.css), without http urls, something like that:

@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 400;
  src: local('Arimo'), url('u8HSyhgzbmPRVjhg5BNhqA.woff') format('woff');
}

4. After that recompile whole theme in Back Office, Performance menu

5. Your shop should work fine now :-)

 

PS You can rename *.WOFF files into something more 'human' ;-)

Link to comment
Share on other sites

×
×
  • Create New...