Skip to content
Browse files

Adds image-rendering mixin

  • Loading branch information...
1 parent 5122d03 commit 1ecc94e136501a629d1b28f8b09fbae359365bac Galen Frechette committed Jul 27, 2012
Showing with 13 additions and 17 deletions.
  1. +0 −17 app/assets/stylesheets/css3/_image-rendering.css
  2. +13 −0 app/assets/stylesheets/css3/_image-rendering.scss
View
17 app/assets/stylesheets/css3/_image-rendering.css
@@ -1,17 +0,0 @@
-@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
- }
-
-}
View
13 app/assets/stylesheets/css3/_image-rendering.scss
@@ -0,0 +1,13 @@
+@mixin image-rendering ($mode:optimizeQuality) {
+
+ @if ($mode == optimize-contrast) {
+ image-rendering: -moz-crisp-edges;
+ image-rendering: -o-crisp-edges;
+ image-rendering: -webkit-optimize-contrast;
+ image-rendering: optimize-contrast;
+ }
+
+ @else {
+ image-rendering: $mode;
+ }
+}

0 comments on commit 1ecc94e

Please sign in to comment.
Something went wrong with that request. Please try again.