From 0fd9c08664b0c7a4cfd6dc2cb850e1050fc064fa Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 1 Feb 2011 22:24:22 -0800 Subject: [PATCH] Android 2.2 compat for @font-face declarations via a MQ redeclaration of the @ff --- .../compass/stylesheets/compass/css3/_font-face.scss | 10 +++++++++- test/fixtures/stylesheets/compass/css/fonts.css | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_font-face.scss b/frameworks/compass/stylesheets/compass/css3/_font-face.scss index f0a58788..c8274cf4 100644 --- a/frameworks/compass/stylesheets/compass/css3/_font-face.scss +++ b/frameworks/compass/stylesheets/compass/css3/_font-face.scss @@ -14,9 +14,17 @@ } @font-face { font-family: quote($name); - @if $eot { src: font-url($eot); } + @if $eot { + src: font-url($eot); } src: local("☺"), $font-files; } + @media screen and (max-device-width: 480px) { + @font-face { + font-family: quote($name); + src: $font-files; + } + } + } // EXAMPLE diff --git a/test/fixtures/stylesheets/compass/css/fonts.css b/test/fixtures/stylesheets/compass/css/fonts.css index 01d9dcbf..8a2196ab 100644 --- a/test/fixtures/stylesheets/compass/css/fonts.css +++ b/test/fixtures/stylesheets/compass/css/fonts.css @@ -2,3 +2,8 @@ @font-face { font-family: "font1"; src: local("☺"), url('/tmp/fonts/font1.woff') format('woff'); } + +@media screen and (max-device-width: 480px) { + @font-face { + font-family: "font1"; + src: url('/tmp/fonts/font1.woff') format('woff'); } }