[Compass Core] +font-face mixin uses stylesheet_url to form urls relative to the css directory.

This commit is contained in:
Chris Eppstein 2009-11-25 22:55:42 -08:00
parent d6b170b851
commit 7da41d027a
2 changed files with 3 additions and 3 deletions

View File

@ -11,14 +11,14 @@
@if !style
font-style= !style
@if !eot
src: url('#{!eot}')
src= stylesheet_url(!eot)
@if !postscript
src: local('#{!name}'), local('#{!postscript}'), #{!font_files}
@else
src: local('#{!name}'), #{!font_files}
// EXAMPLE
+font-face("this name", font_files("this.woff", "woff", "this.otf", "opentype"), "fonts/this.eot", "thisname")
+font-face("this name", font-files("this.woff", "woff", "this.otf", "opentype"), "fonts/this.eot", "thisname")
will generate:

View File

@ -3,7 +3,7 @@ module Compass::SassExtensions::Functions::FontFiles
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
files = []
while args.size > 0
files << "url('#{args.shift}') format('#{args.shift}')"
files << "#{stylesheet_url(args.shift)} format('#{args.shift}')"
end
Sass::Script::String.new(files.join(", "))
end