arielsalminen / vue-design-system

An open source tool for building UI Design Systems with Vue.js
https://vueds.com
MIT License
2.17k stars 224 forks source link

Autoprefixer does not seem to work #128

Closed bitmensch closed 5 years ago

bitmensch commented 5 years ago

Environment

vue-design-system v3.5.5

How to reproduce

In a style block of a vue file add the following CSS rule:

.autoprefixertest {
  user-select: none;
}

Run dev mode via e.g. yarn run start.

Actual output

The generated CSS that can be inspected in the browser is the same as provided.

Expected output

The generated CSS should look like:

.autoprefixertest {
    -ms-user-select: none;
        user-select: none;
}

when using the browserslist that comes by default with vue-design-system as in package.json:

...
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not Explorer > 0",
    "IE 11",
    "not ExplorerMobile > 0",
    "not BlackBerry > 0",
    "not OperaMini all",
    "not OperaMobile > 0"
  ]

I double checked that the expected output is correct by using https://autoprefixer.github.io/, using filter "IE 11" there (which is also present in the default provided browserslist).

bitmensch commented 5 years ago

Just tried to use #127 (branch feat-cli-plugin). When I include the following in the package.json file there, autoprefixer seems to work fine:

...
  "postcss": {
    "plugins": {
      "autoprefixer": true
    }
  },
...
bitmensch commented 5 years ago

I haven't been able to try out if the solution from the previous comment also works with vue-design-system v3.5.5, as I currently cannot do a fresh working install due to some broken third-party dependency.

arielsalminen commented 5 years ago

@benjixx Thanks for reporting. I will test if it fails for me too and provide a fix if so :)

bitmensch commented 5 years ago

@viljamis This would be awesome and much appreciated. It is currently blocking me from producing CSS that works on IE11. Unfortunately, I'm not too deep into the whole build pipeline, so I haven't figured out yet out to make this work with the master branch.

bitmensch commented 5 years ago

Looks like I found the root cause of the problem. postcss-loader is currently not used in the context of the Design System Docs, for the App context it's working. Going to provide a PR soon.

arielsalminen commented 5 years ago

@benjixx Good catch. I’ve merged your PR in now and will do a new release soon.

bitmensch commented 5 years ago

@viljamis Awesome! Keep up the great work. This project is really amazing and a great helper.