Permalink
Browse files

Refactored background scale

  • Loading branch information...
1 parent edbfb88 commit e983cb9ad2a61d4b54bf9144906fd59f976d051e Tom Krush committed Jun 28, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 _mixins.scss
View
6 _mixins.scss
@@ -5,9 +5,13 @@
#{$property}: $value;
}
+@function scale($original_width, $original_height, $new_width) {
+ @return ($original_height / $original_width) * $new_width;
+}
+
/* Support (No IE 8) */
@mixin background-scale($original_width, $original_height, $new_width) {
- background-size: $new_width, ($original_height / $original_width) * $new_width;
+ background-size: $new_width, scale($original_height, $original_width, $new_width);
}
@mixin selection($backgroundColor, $textColor, $opacity: 0.8) {

0 comments on commit e983cb9

Please sign in to comment.