Skip to content

Instantly share code, notes, and snippets.

View joekukish's full-sized avatar

Oscar Bolaños joekukish

  • Adobe
  • Basel, Switzerland
View GitHub Profile
@joekukish
joekukish / font-smoothing-mixin.styl
Last active August 29, 2015 14:05
Stylus `font-smoothing` mixin
// 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 {
@joekukish
joekukish / calc-mixin.styl
Created August 12, 2014 18:48
Stylus `calc()` mixin
// Adds the vendor prefixes for calc.
//
// Usage:
// width: calc('30% - 10px');
// If variables are needed they need to be specified this way.
// width: calc('40% \- %s' % (10px));
calc() {
// vendors to be used by this function
calc-vendors = webkit moz;
@joekukish
joekukish / gradient-mixin.styl
Last active August 29, 2015 14:05
Stylus 'gradient()' mixin
// 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]);