The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS long css styles vs. mutliple class calls Re: long css styles vs. mutliple class calls


Thanks paulie_d,
although not completely ignoring less/sass I don’t much like the idea of it – but then I haven’t used it enough to get over the curve.

I currently favour the ‘chaining’ method but as you mention the (.border-1) example could lead to madness but I do do this to a degree. I have a mini css file of presets that i link to after the reset.css. [my] sites tend to use only three flavours of most layout variables which I refer to as the “coffee shop menu” because it has a skinny, regular & grande versions of the most common classes such as padding, margin, float, text-align, background-color&color combos etc


.paddingMin, .paddingMed and .paddingMax each set a {padding: n;}
.paddingMinT, .paddingMedT, .paddingMaxT each set a {padding-top: n;}

this means that when I need to nudge things around I just chain a skinny, regular or grande class” .paddingMedT or paddingMinL ect.
it really speeds up my design on the fly development and prevents the ‘patchwork quilt’ effect that easily comes from offering too many possibilities when 3 will be fine (or 5 with superMin & superMax).

… my question was really about how efficient/inefficient/irrelevant or inadvisable this method was. to me it make perfect sense but maybe that’s just me.