andywer / postcss-theme

PostCSS plugin to enable versatile theming.
MIT License
87 stars 2 forks source link

Can it work with stylus? #8

Closed mkrn closed 7 years ago

mkrn commented 8 years ago

This looks like an excellent plugin, I'm just a little confused about how it would work with Stylus, LESS, SASS. Also is it only for postcss-modules-values or can work for importing whole files?

What I'm trying to do: @import theme(colors) And variables inside ./src/themes/colors.styl

$panelBgColor = #373536
...

But getting 1| @import theme(colors) String expected

Also, loader is:

test: /\.styl$/,
loader: 'style!css?sourceMap!postcss!stylus?sourceMap' :

Any clues appreciated! Thanks

andywer commented 8 years ago

Hey @mkrn. I'm sorry to tell you that postcss-theme will only work with CSS modules variables (@value).

I guess the only way to make it work with stylus is to use @value vars in stylus (hoping that the syntax won't break stylus parsing)