See the Pen on CodePen.

Randomly generated pattern using SASS while directive

I’ve been using SASS for a few years now, but it’s not often I get to take advantage of some of its more powerful features such as control directives. Here’s a quick experiment that uses the @while directive to loop through and create a number of different classes each with a different colour.

Simple but quite nice.