4 ms·
I've seen places order only box model properties (first height/width, then padding, then border, etc, then everything else), order by responsibility (first font
by lelandfe 5y ago
I've seen places order only box model properties (first height/width, then padding, then border, etc, then everything else), order by responsibility (first fonts, then box model, etc)...
Here's what that gave us: crummy PR reviewers get a silly thing to complain about, developers get an extra thing to think about
Here's what that didn't give us: any reduction in bugs, any meaningful improvement in code legibility
I'm firmly in the camp of "order properties as needed."
- ramesh31 5y ago>Here's what that gave us: crummy PR reviewers get a silly thing to complain about, developers get an extra thing to think about Exact same experience working on a team that had this as a standard. It's absolute nonsense. It can be enforced with CSS linting at this point... but why? Never in my decade of writing CSS have I ever ever wished that the declarations in a codebase were alphabetically sorted for any reason. If your class declarations are that large in the first place, you should be breaking things down better.
- micromacrofoot 5y agoyeah it’s pure pedantry, the worst thing to introduce to pr reviews