Skip to content

Commit

Permalink
Refactored background scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Krush committed Jun 28, 2012
1 parent edbfb88 commit e983cb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _mixins.scss
Expand Up @@ -5,9 +5,13 @@
#{$property}: $value; #{$property}: $value;
} }


@function scale($original_width, $original_height, $new_width) {
@return ($original_height / $original_width) * $new_width;
}

/* Support (No IE 8) */ /* Support (No IE 8) */
@mixin background-scale($original_width, $original_height, $new_width) { @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) { @mixin selection($backgroundColor, $textColor, $opacity: 0.8) {
Expand Down

0 comments on commit e983cb9

Please sign in to comment.