From aa274c5c9bdeb847b72b48998d87d8981105ea3a Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 5 Mar 2015 14:39:18 +0800 Subject: [PATCH] Update stylus --- stylus.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/stylus.md b/stylus.md index 06a47b6ca..51506127e 100644 --- a/stylus.md +++ b/stylus.md @@ -72,7 +72,7 @@ Multiple args: name = 'blue' lookup('light-' + name) -### Built-in functions +### [Built-in functions](http://learnboost.github.io/stylus/docs/bifs.html) alpha(#fff) //=> 1 alpha(rgba(0, 0, 0, 0.2)) //=> 0.2 @@ -80,15 +80,38 @@ Multiple args: dark(black) //=> true light(black) //=> false + hue(#0a0) //=> 50deg + saturation(#f00) //=> 100% + lightness(#f00) //=> 50% + luminosity(#f00) //=> 0.2126 + + hue(#0a0, 0deg) + saturation(#f00, 50%) + lightness(#f00) + lighten(color, 10%) darken(color, 10%) saturate(color, 10%) + desaturate(color, 10%) invert(color) + tint(color, 50%) // mix with white + shade(color, 50%) // mix with black + + unquote(string) + width: image-size(img)[0] height: image-size(img)[1] - unquote(string) +### [Caching](http://learnboost.github.io/stylus/docs/bifs.html#cachekeys) + + size($width) + +cache('w' + $width) + width: $width + .a { size: 10px } + .b { size: 10px } + + // yields: .a, b { width: 10px } Add Property: