Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactored background scale

  • Loading branch information...
commit e983cb9ad2a61d4b54bf9144906fd59f976d051e 1 parent edbfb88
Tom Krush authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 _mixins.scss
6 _mixins.scss
View
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.