我正在尝试使按钮混合如下:
=default_button(!lighter, !darker)
:border= 1px !lighter solid
:background-color #e3e3e3
:background= -webkit-gradient(linear, 0 0, 0 100%, from(!lighter), to(!darker)) repeat-x, #d0581e
:background= -moz-linear-gradient(90deg, !darker, !lighter) repeat-x scroll 0 0 #d0581e
:filter= progid:DXImageTransform.Microsoft.gradient(startColorstr='!lighter', endColorstr='!darker')
:-ms-filter= "progid:DXImageTransform.Microsoft.gradient(startColorstr='!lighter', endColorstr='!darker')"
:zoom 1
:margin 0 0 0 0
:width auto
:padding 2px 14px 2px 14px
:border-radius 10px
:-webkit-border-radius 10px
:-moz-border-radius 10px
:color #FFF
当我编译sass时,对于以-filter和-ms-filter开头的行,我会收到此错误:
SASS :: SyntaxError:预期的rparen令牌,为single_eq令牌
我很确定这是=的位置,但是我不确定如何正确编写它。如果我传递十六进制值而不是!lighter,!darker,它将起作用,因为这样我就可以删除=符号,如下所示:
:filter progid:DXImageTransform.Microsoft.gradient(startColorstr='#F89F16', endColorstr='#d0581e')
:-ms-filter "progid:DXImageTransform.Microsoft.gradient(startColorstr='#F89F16', endColorstr='#d0581e')"
更新语法以
:
代替=
属性定义使用:Check out the SASS Reference, though the examples are in SCSS rather than SASS indented style. Full index of the SASS documentation.