[css-snap-size] Why restrict to width and height?

I really like this new Snap Size draft, badly needed functionality!
But why restrict to width and height? Surely, these are the most common cases, but it comes up with other <length> properties too. E.g. for vertical rhythm, you might want to snap the line-height. Why not a generic way to apply snap to a bunch of properties, instead of defining new snap-xxx properties? It could be a list-valued snap shorthand (snap-property, snap-length), or a snap() function. The property could be defined as only accepting width and height for now, and we can gradually add more properties. As it currently stands, enabling snap on new properties means adding new snap-propertyname properties.
Also, code that just overrides width/height without overriding snap-width, snap-height would produce very unexpected results. This is also the case with a snap property, but not a snap() function.


[1]: https://drafts.csswg.org/css-snap-size/

Lea Verou ✿ http://lea.verou.me ✿ @leaverou

Received on Monday, 22 February 2016 08:10:25 UTC