| I used this technique in my previous startup. I even had shell scripts that generated my LESS files. One of the driving philosophies was that when one saw a CSS class, they should easily be able to find it's definition in the source. Another driving philosophy was that one should easily be able to determine what the class is doing. This lead to classes like `u-centered`. The `u` tells me it's in the utils.less file. Classes starting with `l-` were layout classes, `t-` text classes, etc.. I had classes like this: u-{max,min}-width-{xxs,xs,s,m,l,xl,xxl} t-white u-bg-red (red background) t-h3 l-container-{xxs,xs,s,m,l,xl,xxl} You get the picture. (The nice thing about xl and xs is that you can keep adding x's as you need.) I found it to be very effective. I understand the arguments that it kind of defeats the purpose of CSS, but I think CSS is pretty easy to mess up, and this give you a solid, consistent structure to work with. Of course, I didn't follow this style 100%. There were some cases where it just made sense to use a more semantic style, but I found those case to be few and far between. |
I think it makes sense in small doses but I think once you're using shell scripts to generate all these combinations you've lost the plot.