-
Notifications
You must be signed in to change notification settings - Fork 715
Add a new media query feature: client-width and client-height, which equal to (viewport size - scrollbar size) #2933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the info, @jonjohnjohnson #1766 seems an issue regarding whether to substract the scrollbar size in vw, vh when the computed value of Right now my use case is designing a page which doesn't overflow in a normal fullscreen but can overflow if the user shrinks the window, and I also need a precise size for layout. |
I didn't think of why the two features weren't added in the first place, after a thought today, I kind of understand the reason behind it. May it be a consideration of a paradox? The paradox is: |
Yup, exactly. And further, you can adjust the |
Thanks for the clarification. @tabatkins |
@tabatkins This probably isn't the right place for this, but I've never understood this attitude of not writing specs/features because of possibility of styling loops. If people want to write stupid code then let them write stupid code. JavaScript is open to endless loops, but specs/browsers don't prevent you from running them whether on accident or not. |
@coreyworrell loops in css and loops in js are different beasts. Js is an imperative language, so if you follow an bunch of steps, and then need to start again, and repeat forever, it may be stupid, but at least it is clear what that means. CSS is a declarative language, which describes the results, not the step to get there. The kind of loop we're talking here are circular logic and internal contradictions, not infinitely repeating steps. It's not stupid code as JS loops could be, it's meanignless / ambiguous / self-contradictory code, which browsers couldn't possibly implement, because nobody knows what it is supposed to mean. |
@frivoal Thanks for reply. I understand the difference and what loops we're talking about here. Circular logic and internal contradictions created by the author. If I have circular logic it is my own fault, not the browsers. The rest of my reply I added to #1766 (comment) as it seems to fit there better. |
Uh oh!
There was an error while loading. Please reload this page.
Please consider adding two new media query features:
client-width
andclient-height
which equal to the viewport size if there's no scrollbar;
or equal to (viewport size - scrollbar size) if there's a scrollbar.
client-width
,client-height
are very useful, they are even more useful than the existingwidth
,height
features.Designers typically tend to care more about the available layout size than the size including a scrollbar
The text was updated successfully, but these errors were encountered: