Site icon Bondt

CSS declaration order

I recently heard many developers actually have a system other than the alphabetical one to order the rules inside their CSS. Apparently a growing number of developers is ordering their CSS rules by means of dividing them into sections and then writing them according to what they do.

For instance, you put height and width together, because they decide the size of the element and position, top and left go together for the fact they tell the element where to go. Code Guide shows you the guidelines it wishes to see online: http://codeguide.co/#css-declaration-order

Personally I’m sticking with alphabetical ordering of rules. There’s no real reason to this, but after years of working it still works pretty good. Am I a dinosaur?

What do you use and why?

Exit mobile version