Open mirisuzanne opened 7 months ago
Would make sense. +1 from me.
Only for container units, and not for evaluating size container queries?
For media queries vs viewport units that's difficult because the style that affects scrollbar presence can depend on media queries, but for container queries that should work if you want to?
Oh, I think that would be great to handle both.
The CSS Working Group just discussed [css-values][css-contain] Can we account for scrollbars on containers when sizing 100cq*?
, and agreed to the following:
RESOLVED: both container query units and container queries should take into account relevant scrollbar gutters when theyre present
In #6026 we resolved to have viewport units account for scrollbars, when
overflow:scroll
orscrollbar-gutters:stable
is set on the root (propagating directly to viewport, not frombody
).This will also work for
cq*
units that are relative to the root (no container defined), since they default to the equivalentsv*
units. However, authors are likely to have the same issue on non-root containers.Demo: https://codepen.io/miriamsuzanne/pen/poBjQxm?editors=1100
Would it make sense to apply our above resolution to
cq*
units anywhere that the container in question has eitheroverflow:scroll
orscrollbar-gutters:stable
set?