$themes = {} $defaultTheme = 'tide' @import "./theme-tide.styl" @import "./theme-tigerlilly.styl" parseSpaceVars($theme, $value) $valueSplit = split(' ', $value) $list = '' pop($list) for $property in $valueSplit if ($theme[$property]) push($list, $theme[$property]) else push($list, $property) join(' ', $list) parseCommaVars($theme, $value) $valueSplit = split(',', $value) $list = '' pop($list) for $sentence in $valueSplit push($list, parseSpaceVars($theme, $sentence)) unquote(join(',', $list)) theme($property, $value) / {selector()} {$property}: parseCommaVars($themes[$defaultTheme], $value) for $themeName, $theme in $themes for $selectorPiece in split(',', selector()) / body.theme-{$themeName} {$selectorPiece} {$property}: parseCommaVars($theme, $value)