我刚刚编写了这个 mixin 来帮助解决 IE7 的一些 CSS 继承问题:
=inherit($property)
$property: inherit
.ie7 &
$property: expression(this.parentNode.currentStyle.$property)
编译器没有错误,但我没有从中得到任何输出。
我是这样调用它的:
+inherit(height)
当然,对于所有浏览器,我应该获取 height: inherit
然后在单独的位中为 IE 获取 height: expression(this.parentNode.currentStyle.height)
?
有什么想法吗?
最佳答案
我自己解决了:
=inherit($property)
#{$property}: inherit
.ie6 &,
.ie7 &
#{$property}: expression(this.parentNode.currentStyle.#{$property})
关于css - 用于 CSS 继承的 Sass Mixin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14506580/