我試圖使用循環直通像這樣的項目清單時提供的計數器: colors = red blue orange green yellow
li
for color, i in colors
&:nth-of-type({i}n)
background-color: color
這個例子沒有工作,但預期輸出I尋找的是: li:nth-of-type(1n) {
我正在嘗試使用最新版本獲取stylus.js,其中包含所有功能的1個文件。 我克隆了git的回購https://github.com/stylus/stylus就跑使stylus.js aaas-iMac:stylus aaa$ make stylus.js
make: *** No rule to make target `stylus.js'. Stop.
但我得到這個錯誤,沒有規則。我
在聲明中,如何以編程方式獲取另一個聲明中元素的屬性的值? 例如,採取如下: .header {
height: 50px
}
.footer {
margin-top: // TODO a method for retrieving ".header" height should go here
}
是否有獲得,例如一些方法,.header的的高度與.footer的
我的目標是通過數組創建一組mixin。 我的想法是申請代碼如下: f_colors = (f1 f2 f3 f4 f5)
for $i in 0..length(f_colors)
v = f_colors[$i]
num = $i+1
f{num}cl()
color v
f{num}bg()
background-color