8

我在使用媒体查询混合编译我的 Sass 文件时遇到错误。我遵循了几个教程,但它不会编译。我正在使用Sass 3.3.0.alpha.67 (Bleeding Edge).

这是我的代码

/* Included at the end */
@mixin mobile-only {
    @media (max-width : 320px) {
        @content;
    }
}

/* Included where the rest of my sass is */
body { @include mobile-only { 
            display: none; 
    } 
}

我正在使用 Scout 来编译和观察变化。还有什么我需要做的吗?

4

1 回答 1

0

似乎不再是问题了。在这个codepen http://codepen.io/danielcgold/pen/RRNrPQ中解释了稍微修改的代码。

@mixin start-desktop-size {
  @media (min-width: 1024px) {
    @content;
  }
}

body { 
  @include start-desktop-size { 
    background: red; 
  } 
}
于 2016-05-31T14:53:42.420 回答