小编Bap*_*uuu的帖子

在媒体查询中使用Sass @extend

现在没有错误,但是Sass向我抛出了DEPRECATION WARNING,因为我在一个媒体查询中使用了@extend。我有这样的事情:

.root{
    color: red;
}
@media (max-width: 900px) {
    .root{
        color: blue;
    }
    .extending{
        @extend .root;
    }
}
Run Code Online (Sandbox Code Playgroud)

The warning is set because I have a declaration of .root outside the media. Outside de the @media it's for the normal layout, then inside the same selector is for changing the layout of the page. But the goal here is to have .extending to have its color set to blue only if max-width is 900px, otherwise I don't want …

media sass extend

4
推荐指数
1
解决办法
5942
查看次数

标签 统计

extend ×1

media ×1

sass ×1