4 ms·
a smart guy i worked with early in my career taught us an order that i always liked "outside-in": display, position, flex, margin, padding, border, background c
by rojobuffalo 4y ago
a smart guy i worked with early in my career taught us an order that i always liked "outside-in": display, position, flex, margin, padding, border, background color, text style, etc.. and i'm familiar enough with that approach to know how i like to handle the ones that aren't obvious, like opacity. but i don't think it's practical as a rule for a project with more than one or two people.
with more than 2 people and no automation or lint rule, it will inevitably not be enforced. and once you can't trust the codebase to be consistent, the usefulness of having a rule like that is gone.
alphabetical seems less intuitive to me but it at least has 100% objective answers to every question about what the order should be. no ambiguity and it's probably easier to automate or lint. if the choice is alphabetical, with automation, vs. wild-west, i'd take alphabetical.