Created
August 10, 2013 23:50
-
-
Save samme/6202694 to your computer and use it in GitHub Desktop.
Compass mixins for the CSS4 `image-rendering` property with some cross-browser equivalents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=image-rendering($hint) | |
@if $hint == 'crisp-edges' | |
@if $legacy-support-for-ie8 or $legacy-support-for-ie7 | |
-ms-interpolation-mode: bilinear | |
@if $experimental-support-for-webkit | |
image-rendering: -webkit-optimize-contrast | |
+experimental-value(image-rendering, crisp-edges, $moz: $experimental-support-for-mozilla, $webkit: false, $o: $experimental-support-for-opera, $ms : false, $khtml: false, $official: true) | |
@else if $hint == 'pixelated' | |
@if $legacy-support-for-ie8 or $legacy-support-for-ie7 | |
-ms-interpolation-mode: bilinear | |
image-rendering: pixelated | |
@else if $hint == 'optimizeQuality' or $hint == 'optimizeSpeed' | |
@warn "#{$hint} is deprecated in CSS4 http://dev.w3.org/csswg/css-images/#the-image-rendering" | |
image-rendering: $hint | |
@else if $hint == 'auto' | |
image-rendering: $hint | |
@else | |
@warn "'#{$hint} was ignored because it's not a valid property value for image-rendering (auto, crisp-edges, pixelated) http://dev.w3.org/csswg/css-images/#the-image-rendering" | |
=crisp-edges | |
+image-rendering('crisp-edges') | |
=pixelated | |
+image-rendering('pixelated') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment