【发布时间】:2014-12-04 20:29:01
【问题描述】:
我只想设置一个尚未设置的变量。
所以...
在_layout.scss:
$page-width: 1100px;
但是,在我的 _module.scss 文件中,我不想依赖于 _layout.scss
我想做这样的事情:
$page-width = $page-width ?? 960px;
// If $page-width exists, use it, otherwise set it to a default of 960px;
我想要一些更适合在 SASS 3.2 中使用的东西。我在这里找到了解决方案,否则:
【问题讨论】:
标签: variables sass null-coalescing