LearnBoost/stylus — Issue #451: @import'd mixins don't work in nested mixins
Author: cwolves
Created: 2011-11-01 00:50:13+00:00
State: open

The following stylus

size2( w, h = 0 )
if( 2 == length( w ) )
width unit( w[0], unit( w[0] ) || 'px' )
height unit( w[1], unit( w[1] ) || 'px' )
else
width unit( w, unit(w) || 'px' )
height unit( h, unit(h) || 'px' )

widgetSize( size )
size 102 202
size2 101 201

/**
* Create all widget sizes :)
**/
.widget.small
widgetSize 'sm'

.test
size 103 203

generates

/**
* Create all widget sizes :)
**/
.widget.small {
size: 102 202; /* mixin got ignored here */
width: 101px;
height: 201px;
}
.widget.small .test {
width: 103px;
height: 203px;
}

The `size` fn is defined in a `.styl` function imported using `styl.import( path )`