postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
596 stars 77 forks source link

options in postcss json file #40

Closed Frikki closed 8 years ago

Frikki commented 8 years ago

How do you specify the options in a postcss json file? I’ve tried

{
  "use": [
    "postcss-import",
    "postcss-custom-properties",
    "postcss-cssnext"
  ],
  "postcss-custom-properties": {
    "warnings": false
  },
  "postcss-cssnext": {
    "browsers": [
      "ie >= 10",
      "ie_mob >= 10",
      "ff >= 30",
      "chrome >= 34",
      "safari >= 7",
      "opera >= 23",
      "ios >= 7",
      "android >= 4.4",
      "bb >= 10"
    ]
  }
}

...but it still outputs warnings when custom properties are not scoped to :root element.

MoOx commented 8 years ago

where did you see that it's doable?

Frikki commented 8 years ago

Here https://github.com/postcss/postcss-custom-properties#warnings

MoOx commented 8 years ago

I talk about the json thing. Anyway, if you use postcss-cssnext, you need to pass option to this plugin by postcss-cssnext features options.

Frikki commented 8 years ago

Well, I thought that was what I was doing above. I use a config file that specifies the feature options for postcss-cssnext. But if this cannot be done, then... well.

MoOx commented 8 years ago

This can be done via this option http://cssnext.io/usage/#features (that works in postcss-cssnext)

Frikki commented 8 years ago

Ah, thanks for clearing this up.