Please split preferred content width from viewport/window/page width
Closed this issue · 5 comments
The user should be able to control content width. For example, an unstyled page should show in the user's preferred content width by default, instead of the screen/window width. Pages can then adjust their content based on the preferred content width. Also, it should be possible to set a preferred content width bigger than the screen width, for example if the user happens to prefer horizontal scrollbars on mobile.
This is a pretty significant accessibility issue. Some folks have made userstyles to provide site-specific hacks (see e.g. any of a number of "wide-github" userstyles), but they break regularly.
Users can already do this to some extent, via user stylesheets. Beyond that, this is a browser UI issue, not a CSS issue. (I agree that it would be nice for plain text files to use a UA stylesheet with a reasonable body
width.)
(I now see that you were bumped here from the HTML issue you previously filed. Sorry about that, but it's still the case that this is more of a browser UI issue than something solveable in CSS.)
if browsers had a setting for this, how would it interact with CSS?
how would it interact with page backgrounds (especially background images)? would the browser do letterboxing, or would the background image still fill the background appropriately?
introducing a separate preferred width gives something for CSS authors to add to their stylesheets, so it's more guaranteed to work than telling them to take off their existing "cap the width" stuff. when trying to get something improved, it's a lot easier to get someone to add something than to remove something, tho it raises the question of whether such addition can be considered inconsequential. further, adding a preferred width is backwards compatible with existing pages, while doing any sort of width capping would change (break) how existing pages behave.
I thought :root:not(:defined)
could match this, but everything is defined by default.
please, we hate that we have to hardcode content width on our blog.
let the user decide that stuff. we shouldn't have max-width: 40em;
on our body
. we should not be forcing our opinion of what looks readable on our users. (in fact, we do provide an alternate stylesheet that takes out the max-width
, but only firefox supports that. but even then we shouldn't have to do that.)