Permalink
Browse files

Adds image-rendering mixin

  • Loading branch information...
1 parent 42e727b commit 5122d03b1a21b4d5c7db33b7579d0be57b91f8d8 @csuhta csuhta committed with Galen Frechette Jun 13, 2012
Showing with 18 additions and 0 deletions.
  1. +1 −0 app/assets/stylesheets/_bourbon.scss
  2. +17 −0 app/assets/stylesheets/css3/_image-rendering.css
@@ -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";
@@ -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.