Is there a way to test if PostCSS Autoprefixer is working? Specifically for Rails 6

*爱你&永不变心* 提交于 2019-12-23 17:24:03

问题


I am writing a Rails 6 webapp using Webpacker. Its my understanding that auto-prefixing in Rails 6 works out of the box via PostCSS and its autoprefixer plugin.

However I cannot verify if this library is in fact prefixing my css or not.

Is there a way to confirm if a standard default Rails 6.0.0 app auto-prefixes out of the box?

I have run yarn autoprefixer --info to see the css rules and browsers it applies to and its def applying to my browser chrome 77. And I tried using a parameter that it lists as applying to. It still however dosn't show any prefixed css in dev or production.

Im not sure how postcss-preset-env works so i'm not sure if the css only gets prefixed when using a browser that needs the prefix.

Im coming from using autoprefixer-rails gem that hooks into sprockets and just prefixes everything.

Here is my .postcss.config.js file...

module.exports = {
  plugins: [
    require('postcss-import'),
    require('postcss-flexbugs-fixes'),
    require('postcss-preset-env')({
      autoprefixer: {
        flexbox: 'no-2009'
      },
      stage: 3
    })
  ]
}

来源:https://stackoverflow.com/questions/58423146/is-there-a-way-to-test-if-postcss-autoprefixer-is-working-specifically-for-rail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!