【问题标题】:Stylus - mixin - variable手写笔 - mixin - 变量
【发布时间】:2015-07-20 02:58:59
【问题描述】:

我想我可能完全误解了这一点。

但是假设我有这个重复的 css 代码。

.dot_one {
  animation: dot_one 2s infinite linear;
}
.dot_two {
  animation: dot_two 2s infinite linear;
}
.dot_three {
  animation: dot_three 2s infinite linear;
}

我不应该把它提取成一个函数吗? (但手写笔中的mixin)

dot_mix(myVar)
    animation: myVar 2s infinite linear;

dot_mix(.dot_one)

【问题讨论】:

    标签: stylus


    【解决方案1】:

    我认为这是你之后的语法

    dot_mix(sel)
        {sel}
            animation: dot_one 2s infinite linear
    
    dot_mix('.dot_one')
    dot_mix('.dot_two')
    

    从这里获得http://www.miniarray.com/use-variables-for-selectors-in-stylus/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多