Created
September 17, 2010 01:49
-
-
Save benschwarz/583522 to your computer and use it in GitHub Desktop.
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
// Add Modernizr test for font-smoothing | |
// A designer may wish to darken the colour of a given font when antialiasing is applied | |
// Examples of font-smoothing in action: http://bit.ly/bLeUg1 | |
/* | |
Usage: | |
Add to your page | |
Use html.fontsmoothing h1 { color: xxx; } to make your colours darker | |
*/ | |
Modernizr.addTest('fontsmoothing', function() { | |
var div = document.createElement('div'); | |
if ('fontSmoothing' in div.style) return true; | |
var vendors = ['Webkit', 'Moz', 'ms', 'Khtml']; | |
for(var i in vendors) if (vendors[i] + 'FontSmoothing' in div.style) return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment