The sidebar reduces the size of the viewport, and the viewport is what you're centring within. This is obvious and sensible behaviour from Firefox. Please don't centre based on screen res or whatever. Basing your centre position on anything other than the viewport is user-hostile behaviour.
Perhaps bad design, but user-hostile is a bit of a stretch.
We finally learned to center a div, then browsers added sidebars
121–130 of 172 posts
Re: We finally learned to center a div, then browsers added sidebars
#122I still don't understand the need for this. I mean, it's hn, so "I wanted to" is a perfectly acceptable reason, but when you resize and move the browser window, you don't expect the content to remain where it was. The browser window is not a literal window that shows you what's behind your screen. If the sidebar should behave like an overlay, then that's something that the browser should manage, not each website. From the blogpost I can see that this preference is highly subjective, so it being a browser-wide setting makes much more sense.
Re: We finally learned to center a div, then browsers added sidebars
#123Re: We finally learned to center a div, then browsers added sidebars
#124The net result of what this site is doing seems to result in one of two effects when I open the sidebar, randomly: 1) the sidebar covers the content, while the content has blank space to the right, or 2) the content moves off the right edge of the screen, leaving a large blank space to its left. Both of these are wrong. If I have a sidebar open, the site is now narrower , stop trying to be clever. My immediate reacti…
Agreed, both outcomes are bugs and neither is intended. The idea is simply that, content the site author intended to be horizontally centered stays literally centered on my screen when browser UI changes the viewport.
Re: We finally learned to center a div, then browsers added sidebars
#125Earlier quoted context omitted.
Why? The window and its position shouldn't matter to the app. My tiling window manager doesn't care what your snowflake app thinks it wants, and I don't either.
Then continue to enjoy your broken popup menus and combo box drop downs, for starters.
Yes, some things in some complex applications can break, but there are solutions and, practically, these particular things you listed simply aren't among those that break.
Re: We finally learned to center a div, then browsers added sidebars
#126Earlier quoted context omitted.
I use Firefox with a vertical tabs extension open all the time. Occasionally (rarely, mind) I run into sites that don't bring their full content into view unless I hide the tabs list. Guess they think like the OP.
I used Tree Style Tabs until recently, and never experienced this. Also now with the native vertical tabs I've never seen this.
Re: We finally learned to center a div, then browsers added sidebars
#127This might be some kind of a weird requirement for a piece of art, but I would literally never expect a website to center a div according to the browser window instead of the viewport. It just looks wrong and feels wrong.
The point of centering an element horizontally is to make sure that the content you’re viewing is directly in front of you. Browsers with a sidebar shift the content to the right, assuming the sidebar is on the left, which I’ve come to dislike! Others have expressed the same preference, hence this little snippet on my website.
Re: We finally learned to center a div, then browsers added sidebars
#128The net result of what this site is doing seems to result in one of two effects when I open the sidebar, randomly: 1) the sidebar covers the content, while the content has blank space to the right, or 2) the content moves off the right edge of the screen, leaving a large blank space to its left. Both of these are wrong. If I have a sidebar open, the site is now narrower , stop trying to be clever. My immediate reacti…
Agreed, both outcomes are bugs and neither is intended. The idea is simply that, content the site author intended to be horizontally centered stays literally centered on my screen when browser UI changes the viewport.
Re: We finally learned to center a div, then browsers added sidebars
#129Detecting the difference between window.innerWidth (viewport) and window.outterWidth (window with bar etc) in JS, can be powerful to the browser user via an Extension. However, not so if the site/page uses (e.g a JS Lib).
Personally, i like the viewport vs window separation that the browser provides. I don't want an Element to not budge or care about my sidebar/window dressings, thank you very much.
Re: We finally learned to center a div, then browsers added sidebars
#130Earlier quoted context omitted.
You'd be surprised
That's somehow controversial? There are kiosks used for public browsing, where the user has access to full browser app window and can change elements. There are also ways to get around kiosk mode restrictions, or at least there were for Windows in kiosk mode back in the day. We used it to get browsing access or to just mess with the kiosk. The fun!
And that's probably by far the most value those kiosks ever provided to society - the chance of overriding whatever malicious, socially harmful marketing bullshit purpose they overtly served, and do something fun or useful with them instead.
Alas, opportunities like this are disappearing, as security maximalists are running the show in our industry these days.