3 ms·
I completely agree with your take on what makes for a good shorthand property, I would also have pointed to border: as a good shorthand and flex: as a bad short
by fwlr 4y ago
I completely agree with your take on what makes for a good shorthand property, I would also have pointed to border: as a good shorthand and flex: as a bad shorthand. I think place-self: is a good shorthand, though - the fact that it’s a redundant way to specify two separate properties in a single line is good in this specific case because it matches the developer’s mental model of “center this div please” being a single and simple request. Yes, the truth of layout is that centering stuff is not actually simple and does not involve one single operation, and so we have had to build complex layout systems to handle all the edge cases and complexities, but now that we’ve built those systems it makes sense to offer a shorthand for this common request that resolves to the set of commands required to achieve the result. (e.g. I think ES6’s for-of iteration construct is a good idea, despite redundancy/confusion with the existing C-style for-i++ iteration construct.)