jade
Version:
Jade template engine
33 lines (22 loc) • 456 B
text/stylus
ensure-unit(n)
foo bar
foo bar
foo bar
n is a 'unit'
body
a = 15
b = 15
// yes
foo a == b and (b == 15 ? 1 : 0) ? yes : no
// true
foo a == b and b == a
// yay
foo 15px is a 'unit' and #fff is a 'color'?yay:nah
// nah
foo 15px is a 'color' and #fff is a 'color'?yay:nah
// nah
foo 15px is a 'unit' and #fff is a 'unit'? yay : nah
// true
foo ensure-unit(15)
// false
foo ensure-unit(#fff)