New CSS units that account for mobile viewports with dynamic toolbars
web.dev
web.dev
Kind of amazing that this is literally the unit meant to solve such problems, and yet it doesn't. And the GitHub discussion seems to imply that it's mostly down to what the existing browsers did?
And then they continued to completely ignore this in the new units, only caring about the mobile issues.
Perhaps more relevant now is https://github.com/w3c/csswg-drafts/issues/6026 (loosely about bringing something back). The scrollbar-gutter suggestion would be fairly decent, mitigating the minor ugliness of overflow: scroll if the document isn’t long.
There s so much going wrong with CSS through the years (cough, grid) that one wonders if it's being deliberately sabotaged. But most likely it's suffering from FOMOitis where , every weekly design trend must make its way into CSS.
Or maybe at some point Chrome developers will get fed up and say f'it and invent a new simple pixel level language to do whatever you want.
Does it? `min-height: stretch` (expanded into `min-height: -webkit-fill-available` by autoprefixer) plus a `@supports (min-height:-moz-available)` workaround for FF seems to solve the problem, however inconvenient. That's what I've always used anyway.
[1] https://caniuse.com/mdn-css_properties_min-height_stretch
What's wrong with grid?
Yeah that's what i m talking about. Someone has been racist to tables
With html being a semantic markup language, tables should appropriately be used for tabular data. Grids are addressing a layout concern, in which you want to position stuff on your page just so. With grids, you can easily change the arrangement of your elements within a grid at different screen sizes, or opt out of the grid altogether. With html table markup, that would not be not possible.
I thought the problem this was literally meant to solve was the ambiguity about what a viewport is on mobile browsers with various browser ui elements (address bar, keyboard) taking up space.
Isn't the problem with scrollbars one that it is easy to get into edge cases that result in infinite loops if the gutter space isn't stable?
Getting into infinite loops is a possibility with any non-trivial layout engine if you implement it in certain ways. Per GitHub discussion, though, there is a known algorithm to handle it; the problem is that only Firefox implemented it, and even that as an experiment.
Small, medium, large font sizes. Different widths, heights and all that jazz.
Cant 100% vh or vw just recalculate based on screen elements?
But what would be the implications? Every time some of those dynamic elements appear, everything based on the view port dimensions would also change in size. There are certainly cases where this is exactly what you want but I guess more commonly you would not want to have things change.
There is a real difference between changing the size of your browser window where you want things to adapt and temporarily showing some additional user interface where you do not want everything to move around immediately. This seems actually to suggest that those dynamic elements should be overlays and not change the view port size, but I guess only if one focuses on this single issue. If done as overlays, then you could never see the very top or bottom of a page while those dynamic elements are visible which is not good eitehr.
/*
* Show the element full height but make sure content
* fits the “small” viewport with the toolbars visible.
*/
.full-blend {
height: 100lvh;
padding-block: calc((100lvh - 100svh) / 2 + 1em);
}As you'd expect, none of them do what you'd really want them to do.
About a year ago, the last time I checked the Wikipedia page on energy use, I counted IIRC 10-20 different units being referenced. It is almost as if people were working to prevent uniform understanding and intuition.
standards proliferate because they're bad not because we need to unify standards under one master standard!
If you start by applying it to the topmost element, and then through the tree of the children, then it will work.
> This web feature is now available in all three browser engines!
Lament
There are only three browser engines.