Loops are one of those features that you don’t need every day. But when you do, it’s awfully nice that preprocessors can do it because native HTML and CSS cannot.
(That’s what the above is. The
when clause could be thought of exactly as
for loops in Stylus.
for loop actually behaves more like an
each loop, so here’s a more obvious
each loop example:
I never understood the meaning of preprocessors. As long as you have PHP available, why using something else. With DynCSS – CSS per PHP you can just use CSS within PHP, use variables, loops, if-else, cases, etc.
(it’s Germany, but if you download the files (ZIP) you can see how easy it it. No compiling, now other script language to learn. Just pure PHP, easy and readable CSS as minified output.
CSS-in-PHP. That’s just what we needed…