W3C home > Mailing lists > Public > www-style@w3.org > February 2016

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

From: Lea Verou <lea@verou.me>
Date: Mon, 22 Feb 2016 03:09:59 -0500
Message-Id: <2FFCB26F-9AD0-4C1B-BED0-4D5F36462682@verou.me>
To: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:57 UTC