visionmedia/nib — Issue #67: linear-gradient with variables
Author: cmr
Created: 2012-02-05 12:36:40+00:00
State: open

@import 'nib'

a
background-image: linear-gradient(bottom, hsl(0, 0%, 35%), hsl(0, 0%, 45%))

works, but

@import 'nib'

dark-gradient = linear-gradient(bottom, hsl(0, 0%, 35%), hsl(0, 0%, 45%))

doesn't, it fails with

/usr/lib64/node_modules/stylus/bin/stylus:511
throw err;
^
Error: nib/gradients.styl:108
104| */
105|
106| linear-gradient(start, stops...)
107| error('color stops required') unless length(stops)
> 108| prop = current-property[0]
109| val = current-property[1]
110| stops = normalize-stops(stops)
111|

cannot perform null[(0)]

at Null.operate (/usr/lib64/node_modules/stylus/lib/nodes/node.js:189:13)
at Evaluator.visitBinOp (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:388:28)
at Evaluator. (/usr/lib64/node_modules/stylus/lib/visitor/index.js:28:39)
at Evaluator.visit (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:74:18)
at Evaluator. (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:451:26)
at Evaluator. (/usr/lib64/node_modules/stylus/lib/visitor/index.js:28:39)
at Evaluator.visit (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:74:18)
at Evaluator. (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:451:26)
at Evaluator. (/usr/lib64/node_modules/stylus/lib/visitor/index.js:28:39)
at Evaluator.visit (/usr/lib64/node_modules/stylus/lib/visitor/evaluator.js:74:18)

Why does nib need to use current-property? Can it be avoided?