sass 新手,期待预期的选择器 [英] New to sass, expecting expected selector
本文介绍了sass 新手,期待预期的选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是 sass 新手并尝试了一些代码:
Im new to sass and tried some code:
$blue: #3bbfce
$margin: 16px
.content-navigation
border-color: $blue
color: darken($blue, 9%)
.border
padding: $margin / 2
margin: $margin / 2
border-color: $blue
但现在在我的 rails 应用程序中,我收到此错误:
But now in my rails app i get this error:
Invalid CSS after "$margin": expected selector or at-rule, was ": 16px"
怎么了?
现在我用 zurb 尝试了一些东西:
Now i tried something with zurb:
.your-class-name {
@include button;
@include dropdown-button($padding, $pip-color, $base-style);
}
但现在我得到了错误
Undefined mixin 'dropdown-button'.
推荐答案
样式声明后缺少分号.您还需要将选择器声明封装在大括号中:
You're missing semicolons after your style declarations. You also need to encapsulate selector declarations within curly brackets:
$blue: #3bbfce;
$margin: 16px;
.content-navigation {
border-color: $blue;
color: darken($blue, 9%);
}
.border {
padding: $margin / 2;
margin: $margin / 2;
border-color: $blue;
}
您可能希望阅读 SASS 创建者的本入门书.
You might like to read over this primer from the creators of SASS.
这篇关于sass 新手,期待预期的选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文