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.
編集:これは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 自体はリストから静的な値しか取得できません。