【问题标题】:Using oval border-radius in a SASS mixin在 SASS mixin 中使用椭圆形边界半径
【发布时间】:2013-07-12 12:37:18
【问题描述】:
//Usage
@include border-radius(150px / 70px); 

//Mixin
@mixin border-radius($values) {
  -webkit-border-radius: $values;
  -moz-border-radius: $values;
  border-radius: $values;
}

结果是:

border-radius: the division of 150/70, which is 2.xxxxx-something

如何在同一个 mixin 中解决这个问题?

【问题讨论】:

    标签: css sass mixins


    【解决方案1】:

    这里需要使用字符串插值:

    .foo {
      @include border-radius(#{150px} / 70px);
    }
    

    【讨论】:

    • 我给你正确的答案。但是我选择了@include border-radius("150px / 70px"); 然后我在mixin 中使用了unquote :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-07
    • 2010-12-18
    • 1970-01-01
    • 2022-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多