1

Is it possible, using SASS, to define an array of colors and then pick one at random and apply it to an element?

Many thanks in advance.

4

1 に答える 1

0

編集:これはSassで直接サポートされるようになりました

sass では直接サポートされていませんが、http://codepen.io を使用て Sass エディターで random() 関数にアクセスできます。

http://blog.codepen.io/2013/08/26/random-function-in-sass/ https://gist.github.com/chriseppstein/1561650

ただし、上記のコメントで述べたように、CSS をコンパイルするときにのみ発生しますが、CSS 自体はリストから静的な値しか取得できません。

于 2013-09-17T18:43:43.047 に答える