postcss / postcss-simple-vars

PostCSS plugin for Sass-like variables
MIT License
419 stars 35 forks source link

Nested variables from js file #7

Closed geddski closed 9 years ago

geddski commented 9 years ago

I'm passing some variables into postcss-simple-vars:

postcssSimpleVars({variables: require('./common/styles.js') })

Inside that file I'd like to namespace the styles like so:

  module.exports = {
     layout: {
       header: '300px'
    },
    theme: {
       main: '#ccc'
    }
  }

And then use these variables in my css files:

body{
  background: $theme.main
}
ai commented 9 years ago

Maybe postcss-map is better for this case.

ai commented 9 years ago

It makes code too diificult. Better do it in other plugin.

geddski commented 9 years ago

For anyone wanting nested variables I released a webpack loader for it.