3 ms·
While I list most CSS properties together, I actually collect all box elements like this: margin-top: ... border-top: ... padding-top: ... height: ...
by makecheck 17y ago
While I list most CSS properties together, I actually collect all box elements like this:
margin-top: ...
border-top: ...
padding-top: ...
height: ...
padding-bottom: ...
border-bottom: ...
margin-bottom: ...
margin-left: ...
border-left: ...
padding-left: ...
width: ...
padding-right: ...
border-right: ...
margin-right: ...
The components are listed in outside-in order, with each axis separate. I find this easy to visualize and tweak.
Most other properties, however, I do just list together alphabetically.
- alabut 17y agoThis is the opposite of readable, for me. Even assuming that you're using the shorthand notation to compact the properties vertically and that you're listing out each one here because they need to have different properties, grouping the related ones together (all the margins, paddings, etc) would make it much easier to scan. Plus I've gotten used to ordering properties in the TRouBLe format (Top Right Bottom Left, just like the browser does in the shortcut notation) and would list it that way, rather than top/bottom, left/right.