gpt4 book ai didi

css - Sass 的媒体查询无法编译

转载 作者:技术小花猫 更新时间:2023-10-29 11:13:23 28 4
gpt4 key购买 nike

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

这是我的代码

/* 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 进行编译并观察变化。还有什么我需要做的吗?

最佳答案

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

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

body {
@include start-desktop-size {
background: red;
}
}

关于css - Sass 的媒体查询无法编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14082604/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com