Miriam Suzanne | Art & Code

CSS Tricks: Loops in CSS Preprocessors

I wrote an article for CSS-Tricks — a look at what loops can do, and how to use them in the major CSS preprocessors: Sass, Less, and Stylus. Each language provides a unique syntax, but they all get the job done.

“Preprocessor loops are most useful when you have a collection (list or array) of items to loop over — like an array of social media icons and colors, or a list of state-modifiers (success, warning, error, etc). Because for-each loops are tied to a known collection of items, they tend to be the most concrete and understandable loops.”

Read the full article on CSS-Tricks »

Start a conversation —

Talk to me about art, code, or collaboration; hire me to speak; or just say hello!

Reach me through my contact form or online @mirisuzanne.

headshot

Subscribe to my newsletter