Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit f93cf9ed6a588ce4473f9cb4e235bb151bcfdaa1 1 parent dd3d358
Phil LaPier authored
Showing with 18 additions and 9 deletions.
  1. +18 −9 app/assets/stylesheets/addons/_font-face.scss
View
27 app/assets/stylesheets/addons/_font-face.scss
@@ -1,12 +1,21 @@
-@mixin font-face($font-family, $file-path, $weight: normal, $style: normal ) {
+@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
@font-face {
- font-family: $font-family;
+ font-family: $font-family;
+ font-weight: $weight;
+ font-style: $style;
+
+ @if $asset-pipeline == true {
+ src: font-url('#{$file-path}.eot');
+ src: font-url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
+ font-url('#{$file-path}.woff') format('woff'),
+ font-url('#{$file-path}.ttf') format('truetype'),
+ font-url('#{$file-path}.svg##{$font-family}') format('svg');
+ } @else {
src: url('#{$file-path}.eot');
- src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
- url('#{$file-path}.woff') format('woff'),
- url('#{$file-path}.ttf') format('truetype'),
- url('#{$file-path}.svg##{$font-family}') format('svg');
- font-weight: $weight;
- font-style: $style;
+ src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
+ url('#{$file-path}.woff') format('woff'),
+ url('#{$file-path}.ttf') format('truetype'),
+ url('#{$file-path}.svg##{$font-family}') format('svg');
+ }
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.