travco / postcss-extend

A PostCSS plugin to minimize the number of repeat-selectors and rules you write
MIT License
114 stars 8 forks source link

Can we define placeholders in JavaScript? #8

Closed onlywei closed 8 years ago

onlywei commented 8 years ago

Just like with postcss-simple-vars, and postcss-mixins, can we do this:

postcss()
  .use(simpleExtend({
    placeholders: {
      'simple-list': {
        'list-style-type': 'none'
      }
    }
  }))
  // or .use(simpleExtend) 
  .process(inputCss)
  .css;
travco commented 8 years ago

If you're referring to having the ability to turn shorthand labels or CSS variables like "simple-list" into " 'list-style-type': 'none' ". Then no, that isn't in the scope of the plugin. That's why there are so many plugins for PostCSS, it's because they all do fairly specific jobs.

If you're referring to placeholder classes (that are replaced when they are extended, or dissapear when they aren't) - you can look at this part of the README: https://github.com/travco/postcss-extend#defining-placeholders

I hope that helps.