- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Mon, 23 Sep 2024 17:26:56 +0000
- To: public-css-archive@w3.org
Chatted with Kevin in person, and I appreciate their idea more fully now. The idea is that a hairline border is 1px wide, geometrically, but we *paint* it using smaller device pixels if possible (UA-defined). The device pixels are chosen to be an "inner" border, so the padding box remains the specified size and we can make the outer device pixels transparent. (Possibly we could offer a choice here, but we'd need to define what to paint on the inner device pixels if it's painted into the "outer" ones. Probably not needed; I'd definitely say avoid it until it's asked for with a good example.) This should definitely apply in the other border-like properties, like column-rule, but there we should define it as choosing a *centered* set of device pixels (as centered as possible, at least). The benefit of this is that the layout size of a hairline border is predictable across devices. We already know from the historical example of trying to allow the physical lengths to be true (with a varying ratio with `px`) that authors very commonly will design a layout that works on their device, but breaks on one with a different unit ratio. So, having a hairline border *actually* be sized to its visible width has real potential to cause accidentally broken layouts. It also would require a relayout when moving a window between screens with potentially different resolutions (but maybe we do that already?), while Kevin's idea just requires a repaint. > Exposing the resolution directly would make it clearer IMO, i.e., you'd do calc(1px / env(resolution)) and it's easy to see why at different resolutions you get overflow vs. not... My argument that hairlines are only `1px / resolution` *right now*, but won't necessarily be in the future with higher-res screens, still applies. There's also probably a reasonable accessibility argument that UAs might want to offer the ability to force "thick" hairlines (maybe tied into other options that are about vision issues). So offering this ability at the low level of authors just supplying a tiny length makes that more difficult, but Kevin's idea makes it pretty trivial. Authors already *should* be allowing for the possibility of a 1px "hairline", given the continuing existence of 96dpi devices, but I give good odds on most authors assuming that hairlines are *necessarily* thinner than 1px because they look that way on all their devices. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3720#issuecomment-2368916115 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 23 September 2024 17:26:56 UTC