Sass函式 值列表index

2022-05-08 18:33:11 字數 438 閱讀 3924

ndex() 函式類似於索引一樣,主要讓你找到某個值在列表中所處的位置。在 sass 中,第乙個值就是1,第二個值就是 2,依此類推:

>> index(1px solid red, 1px)

1>> index(1px solid red, solid)

2>> index(1px solid red, red)

3

在 index() 函式中,如果指定的值不在列表中(沒有找到相應的值),那麼返回的值將是 false,相反就會返回對應的值在列表中所處的位置。

>> index(1px solid red,dotted) //列表中沒有找到 dotted

false

>> index(1px solid red,solid) //列表中找到 solid 值,並且返回他的位置值 2

2

scss值列表 sass列表函式

join 函式是將兩個列表連線合併成乙個列表。join 10px 20px,30px 40px 10px 20px 30px 40px join blue,red abc,def 0000ff,ff0000,aabbcc,ddeeff join blue,red abc def 0000ff,ff0...

Sass函式 列表函式nth

語法 nth list,n nth 函式用來指定列表中某個位置的值。不過在 sass 中,nth 函式和其他語言不同,1 是指列表中的第乙個標籤值,2 是指列給中的第二個標籤值,依此類推。如 nth 10px 20px 30px,1 10px nth helvetica,arial,sans ser...

Sass 顏色函式

1 2 sass 顏色函式 3 rgb 顏色函式 4 1.rgb red,green,blue 根據紅 綠 藍三個值建立乙個顏色 5 rgb 200,40,88 根據r 200,g 40,b 88計算出乙個十六進製制顏色值 6 c82858 7 2.rgba red,green,blue,alpha...