@supports没有从SASS编译到CSS

时间:2018-03-02 16:49:53

标签: css sass gruntjs

*对不起我的英文

我使用Visual Studio Code。用SASS编写代码。所有自动化都写在Grunt中(对于预处理器我使用grunt-contrib-sass)

这是我的代码:

.news {
  background-color: #f8f5f2;
  border-bottom: 1px solid #e5ddd5;

  @supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) {
    -webkit-clip-path: polygon(0 0, 50% 34px, 100% 0, 100% 100%, 0 100%);
    clip-path: polygon(0 0, 50% 34px, 100% 0, 100% 100%, 0 100%);
    margin-top: -35px;
  }
}

编译后css中没有@supports指令。我还试着在LESS和其他代码编辑器中做到这一点

问题是什么?

1 个答案:

答案 0 :(得分:0)

你的代码为我编译,所以它没有任何问题,因此。我怀疑你使用的是旧版本的Sass,在这种情况下@supports将无法正确编译。请参阅2014年修复的GitHub问题:https://github.com/sass/libsass/pull/612