Search code examples
sasscompass

when compass save scss file to css file the " @font face ( name, font-file( ) ) " doesn't work properly


I try to use woff file to change font. Can u guys help me why the CSS take the weird numbers after extension

config.rb

fonts_dir = "stylesheets/fonts"

SCSS

@include font-face("caviardreams", font-files("caviardreams-      webfont.woff", "caviardreams-webfont.ttf", "caviardreams-webfont.svg", "caviardreams-webfont.eot") );

CSS

@font-face { font-family: "caviardreams"; src: url('/stylesheets/fonts/caviardreams-webfont.woff?1436806012') format('woff'), url('/stylesheets/fonts/caviardreams-webfont.ttf?1436806012') format('truetype'), url('/stylesheets/fonts/caviardreams-webfont.svg?1436806012') format('svg'), url('/stylesheets/fonts/caviardreams-webfont.eot?1436806012') format('embedded-opentype');}

I guess when compass find the font it gives the url with weird number('?1436806012'), and it doesnt work in the chrome browser. If you guys need whole code. please tell me


Solution

  • I found the solution.

    If somebody have same problem as I have,

    It's probably "config.rb" need to be uncomment relative_assets = "true"

    What I mean is "REMOVE #" from #relative_assets = "true"

    but don't do it if you use http_font_dir