Skip to content

Commit

Permalink
Adds image-rendering mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Csuhta authored and Galen Frechette committed Jul 27, 2012
1 parent 42e727b commit 5122d03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/stylesheets/_bourbon.scss
Expand Up @@ -21,6 +21,7 @@
@import "css3/box-sizing";
@import "css3/columns";
@import "css3/flex-box";
@import "css3/image-rendering";
@import "css3/inline-block";
@import "css3/linear-gradient";
@import "css3/prefixer";
Expand Down
17 changes: 17 additions & 0 deletions app/assets/stylesheets/css3/_image-rendering.css
@@ -0,0 +1,17 @@
@mixin image-rendering ($mode:optimizeQuality) {

@if ($mode == optimizeQuality) or ($mode == bicubic) or ($mode == bilinear) {
image-rendering: optimizeQuality; // Gecko, Presto, Webkit
-ms-interpolation-mode: bicubic;
}

@else if ($mode == optimizeSpeed) or ($mode == nearest-neighbor) or ($mode == optimize-contrast) or ($mode == crisp-edges) {
image-rendering: optimizeSpeed; // Old versions of Firefox/Gecko, Safari when optimize-contrast not supported
image-rendering: -moz-crisp-edges; // Gecko in Firefox 6+
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast; // Safari/Webkit nightlies
-ms-interpolation-mode: nearest-neighbor;
image-rendering: optimize-contrast; // As per spec
}

}

0 comments on commit 5122d03

Please sign in to comment.