postcss / postcss-simple-vars

PostCSS plugin for Sass-like variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nested variables from js file

geddski opened this issue · comments

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
}

Maybe postcss-map is better for this case.

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

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