Last active
August 29, 2015 14:05
-
-
Save joekukish/be7f2a46511966ec2061 to your computer and use it in GitHub Desktop.
Stylus `font-smoothing` mixin
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
// Allows setting the font-smoothing option for styling better fonts. Font | |
// smoothing is specially valuable with custom fonts depending on the background | |
// color. Accepted values are none, antialiased, subpixel-antialiased. | |
// | |
// Usage: | |
// font-smoothing: antialiased; | |
// | |
// Compatibility untested. | |
font-smoothing() { | |
if current-property { | |
-webkit-{current-property}: arguments | |
if arguments == antialiased { | |
-moz-osx-{current-property}: grayscale | |
} else if arguments == subpixel-antialiased { | |
-moz-osx-{current-property}: auto | |
} | |
{current-property}: arguments | |
} else { | |
error('font-smoothing() must be used within a property'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment