Re: [csswg-drafts] [css-values] Should viewport units still depend on scrollbar width for overflow:scroll?

> I don't think your (1) is quite correct, because testing whether your current calculation is correct is more complex than for em units, 

Only in abstract. In practice, you do the calculations already every layout, to figure out how wide your scrollbar should be.  (And if you cache results and only update when necessary, well, that's the exact work you'd need to do for viewport units too.)  Once you're already doing the "figure out how wide the scrollbar is" math, checking if you need to update is just a numeric comparison to the current value.

> and the effect is global rather than local. (The effect with em units can be a wide effect when font-size inherits, but everywhere it happens it's a local effect.)

font-size almost always inherits; the fact that it's local in application is irrelevant when the entire page gets spammed with "local" updates.

> I also tend to think adding viewport units themselves were a mistake -- something that we thought was simple, but really should have been addressed by layout systems rather than units, and now turn out to be not as simple as we thought.

That would have been a huge mistake; one of the big uses of viewport units is piping page-size information into unexpected places, like font-size so your text gets bigger/smaller according to the viewport size.  That can't be done with layout systems.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1766#issuecomment-326061655 using your GitHub account

Received on Wednesday, 30 August 2017 17:26:26 UTC