Skip to content
This repository
Browse code

Updated font-face mixin to accept an asset-pipeline argument.

  • Loading branch information...
commit f93cf9ed6a588ce4473f9cb4e235bb151bcfdaa1 1 parent dd3d358
Phil LaPier authored October 24, 2012
27  app/assets/stylesheets/addons/_font-face.scss
... ...
@@ -1,12 +1,21 @@
1  
-@mixin font-face($font-family, $file-path, $weight: normal, $style: normal ) {
  1
+@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
2 2
   @font-face {
3  
-      font-family: $font-family;
  3
+    font-family: $font-family;
  4
+    font-weight: $weight;
  5
+    font-style: $style;
  6
+
  7
+    @if $asset-pipeline == true {
  8
+      src: font-url('#{$file-path}.eot');
  9
+      src: font-url('#{$file-path}.eot?#iefix')          format('embedded-opentype'),
  10
+           font-url('#{$file-path}.woff')                format('woff'),
  11
+           font-url('#{$file-path}.ttf')                 format('truetype'),
  12
+           font-url('#{$file-path}.svg##{$font-family}') format('svg');
  13
+    } @else {
4 14
       src: url('#{$file-path}.eot');
5  
-      src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
6  
-           url('#{$file-path}.woff') format('woff'),
7  
-           url('#{$file-path}.ttf') format('truetype'),
8  
-           url('#{$file-path}.svg##{$font-family}') format('svg');
9  
-      font-weight: $weight;
10  
-      font-style: $style;
  15
+      src: url('#{$file-path}.eot?#iefix')               format('embedded-opentype'),
  16
+           url('#{$file-path}.woff')                     format('woff'),
  17
+           url('#{$file-path}.ttf')                      format('truetype'),
  18
+           url('#{$file-path}.svg##{$font-family}')      format('svg');
  19
+    }
11 20
   }
12  
-}
  21
+}

0 notes on commit f93cf9e

Please sign in to comment.
Something went wrong with that request. Please try again.