初次尝试SASS,遇到hack问题,再次记下点滴。
原先代码:
#yzm{ +display: inline;}
报错提示:
Syntax error: Invalid CSS after "...+display:inline": expected "{", was ";" on line 31 of D:\root\wwwdemo\test\wtd\caigou\style.scss Use --trace for backtrace.
解决方案:
$hack_ie7:'+'; #yzm{ #{$hack_ie7}display: inline; }
其他参考:(我没看懂,希望有看到的人懂的帮下解释下,我猜大致是传参执行方法的意思)
// Visible for IE <= 7 =ie7-hack($property, $ie7-value) ##{$property}: #{$ie7-value} // Visible for IE <= 6 =ie6-hack($property, $ie6-value) _#{$property}: #{$ie6-value} // this mixin has to be called last due to its usage of the ie8-hack mixin usage =gt-ie6-hack($property, $value) +ie7-hack($property, $value) +ie8-hack($property, $value) // Visible for IE = 8 // this mixin has to be called last // @see: http://dimox.net/personal-css-hacks-for-ie6-ie7-ie8/ =ie8-hack($property, $ie8-value) #{$property}: #{$ie8-value}#{"\0/"} // Allows to apply horizontal padding for buttons // @see: http://www.mrkirkland.com/internet-explorer-submit-button-horizontal-padding/ =ie7-button-fix +ie7-hack('overflow', 'visible')