【问题标题】:redefine $susy values at breakpoint container在断点容器处重新定义 $susy 值
【发布时间】:2014-08-04 06:10:01
【问题描述】:
我正在尝试在媒体查询中重新定义 $susy 属性容器。我正在尝试运行
@include breakpoint($mobile) {
$susy: (
container: 100%,
);
}
当我编译 cmd 时说尝试使用 $susy: (container: 100%)!global 而不是——我试过了,但它不起作用。
有什么想法吗?
谢谢
【问题讨论】:
标签:
containers
breakpoints
susy-compass
【解决方案1】:
据我了解,$susy 是您设置网站基本布局的全局设置。对于断点处的后续布局,我会使用新地图,例如$平板电脑,$桌面。
【解决方案2】:
$susy 是一个全局设置,Sass 不会将变量更改范围限定为媒体上下文。您可以按照@user2713715 的建议进行操作,并为其他布局指定新名称,但 Susy 也有一个工具可以帮助将这些设置应用于不同的代码块。最基本的是with-layout:
@include breakpoint($mobile) {
@include with-layout(100%) { // can pass in shorthand, or a map of new settings
// any code in here will use the new layout...
}
}
但是,如果您使用断点,我们有一个更好的捷径:
@include susy-breakpoint($mobile, (container: 100%)) {
// again: you can use the shorthand or a settings map.
// any code in here will use the new layout...
}