[Compass Core] +font-face mixin uses stylesheet_url to form urls relative to the css directory.
This commit is contained in:
parent
d6b170b851
commit
7da41d027a
@ -11,14 +11,14 @@
|
|||||||
@if !style
|
@if !style
|
||||||
font-style= !style
|
font-style= !style
|
||||||
@if !eot
|
@if !eot
|
||||||
src: url('#{!eot}')
|
src= stylesheet_url(!eot)
|
||||||
@if !postscript
|
@if !postscript
|
||||||
src: local('#{!name}'), local('#{!postscript}'), #{!font_files}
|
src: local('#{!name}'), local('#{!postscript}'), #{!font_files}
|
||||||
@else
|
@else
|
||||||
src: local('#{!name}'), #{!font_files}
|
src: local('#{!name}'), #{!font_files}
|
||||||
|
|
||||||
// EXAMPLE
|
// 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:
|
will generate:
|
||||||
|
|
||||||
|
@ -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
|
raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
|
||||||
files = []
|
files = []
|
||||||
while args.size > 0
|
while args.size > 0
|
||||||
files << "url('#{args.shift}') format('#{args.shift}')"
|
files << "#{stylesheet_url(args.shift)} format('#{args.shift}')"
|
||||||
end
|
end
|
||||||
Sass::Script::String.new(files.join(", "))
|
Sass::Script::String.new(files.join(", "))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user