From 7da41d027a348888180d8ef33672fd0cde4d2c9a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 25 Nov 2009 22:55:42 -0800 Subject: [PATCH] [Compass Core] +font-face mixin uses stylesheet_url to form urls relative to the css directory. --- .../compass/stylesheets/compass/css3/_font_face.sass | 4 ++-- lib/compass/sass_extensions/functions/font_files.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass b/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass index 7256dd01..7be10200 100644 --- a/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass +++ b/lib/compass/frameworks/compass/stylesheets/compass/css3/_font_face.sass @@ -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: diff --git a/lib/compass/sass_extensions/functions/font_files.rb b/lib/compass/sass_extensions/functions/font_files.rb index 9b12b7e1..f46b2721 100644 --- a/lib/compass/sass_extensions/functions/font_files.rb +++ b/lib/compass/sass_extensions/functions/font_files.rb @@ -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