Autoprefixer 无法为自定义滚动条生成前缀

作者: sarazhang123创建于 2017年4月17日更新于 2023年7月25日
标签enhancement

我使用 grunt-postcss 生成 CSS 前缀。配置如下:

processors: [
  require('autoprefixer') {
    browsers: [
      '> 0.04%'
    ]
  }
]

Sass 如下:

@mixin custom-scroll($thumb-bgcolor: $gray-background-color, $track-bgcolor: $white-background-color) {
  &::scrollbar {
    background-color: transparent;
    width: 5px;
    height: 5px;
  }

  &::scrollbar-thumb {
    background: $thumb-bgcolor;
    border-radius: 2px;
    min-height: 6px;
    width: 4px;
  }

  &::scrollbar-track {
    background: $track-bgcolor;
    border-radius: 2px;
  }
}

但是,autoprefixer 无法为 scrollbar-xxx 生成前缀,例如 -webkit-scrollbar-webkit-scrollbar-thumb-webkit-scrollbar-track。这是一个 bug,还是我的配置有问题?

内容来源: postcss/autoprefixer