Last active
August 29, 2015 14:05
-
-
Save joekukish/8d689be20c54d1237301 to your computer and use it in GitHub Desktop.
Stylus 'gradient()' 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
// Adds a linear gradient with the background coral fallback. The | |
// last parameter is optional | |
// | |
// background: gradient(top, #FFFFFF, #000000, 50%); | |
// | |
gradient() { | |
if current-property { | |
// the fallback for IE | |
add-property(current-property[0], mix(arguments[1], arguments[2], arguments[3]?arguments[3]:50%)); | |
linear-gradient(arguments[0], arguments[1], arguments[2]); | |
} else { | |
error('gradient() must be used within a property'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment