【问题标题】:Sass Mixin for CSS Inherit用于 CSS 继承的 Sass Mixin
【发布时间】:2013-01-25 02:00:13
【问题描述】:

我刚刚编写了这个 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)?

有什么想法吗?

【问题讨论】:

    标签: css sass inheritance


    【解决方案1】:

    自己解决了这个问题:

    =inherit($property)
        #{$property}: inherit
    
        .ie6 &,
        .ie7 &
            #{$property}: expression(this.parentNode.currentStyle.#{$property})
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-20
      • 1970-01-01
      • 2012-06-16
      • 2019-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-04
      相关资源
      最近更新 更多