-
Notifications
You must be signed in to change notification settings - Fork 518
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
Add a default background and color on :root? #17
Comments
According to a friend of mine, merely setting the GTK theme to a dark theme like Adawaita dark makes Firefox use dark background light text by default, so it is likely it is actually a very common thing. |
^ i can reproduce that on Gentoo. i have to explicitly disable "use system colors" in Firefox' settings to unbreak half of the internet |
I was going to open a new issue for this! Here's an example of Ubuntu18.04 with the GNOME theme
|
I think it's because you put it in a Firefox theme file it may impact the UI, normal websites are not able to do stuff like, that I assure you |
I see. But l think it's a good idea to keep the impact of this as small as possible and we can go from there later on. It's minireset.css after all, and I think that's possibly why the author is hesitant to merge the pull request as it is, because he wants to keep the functions of this reset file minimal. |
I don't think so you just add it to the file and you're done, it wouldn't have any secondary effect as far as I'm aware as |
@Pizzacus How about the scrollbar? I need to test that out at some point. |
While scrollbars are usually themed, I don't see how this would ever cause any problems, as they're to the side, not over the background, so it doesn't matter what colour they are. |
@Pizzacus I don't think it's about "causing problems" per se. The scrollbar is part of a consistent user experience, and I don't think it's the call of a reset stylesheet how it appears. Some websites have them styled carefully, others like my own website simply disable them. |
Whoops, I forgot to reply to this.
Indeed but can you explain to me why we would put a default background on inputs, and not on the overall page, when it is the exact same issue of browser defaults not being what a dev would expect or be able to predict. Like, it's really the exact same thing, if you fix one, you may as well fix the other. |
I guess I think of the scrollbar as a widget of the browser, and not as an element of the webpage; therefore, not touching the scrollbar is consistent browser experience for the user, whereas default white background is consistent development experience for the developer. When you are one of the very few webpages modifying scrollbar by default, it's kinda like running QT apps under GNOME, if you've had the experience. Most browsers know to default the page background to white, and that has been the convention for most other html elements as well; by setting textboxes to be white explicitly, it's not so much taking a side as much as it is ensuring the convention is followed. When textboxes are affected by a theme, that breaks the convention and thus a lot of pages that follow the convention. Not to mention the changes made by the theme makes these default textboxes unusable. On the other hand, the scrollbar was always untouched by the webpage, until a few years ago with CSS3 where you can customize it. By setting the scrollbar a certain default way, thus imply "taking a side' and affecting too much. Plus, let's not touch it of it's not broken. |
This conversation reminds me of political debates comparing a conservative distribution of power versus a progressive distribution of power; both have pros and cons. However, I think minireset is designed to do the minimum possible to create a consistent development experience, and that's why I suggest changing as few things as possible. |
This is false we just explained it, Firefox may set the page to black by default on some themes, there is even an option in the settings to change it. As you said, it is a convention to set the page background to white and the text to black, but not all browsers follow it, while developpers would expect them to, so like that, we can fix it, and it's only one single line along with the other stuff you're already normalising in the PR. And I've never talked about touching the scrollbar, scrollbar styling is too inconsistent across browsers anyway. |
Ah, I see, the reason why that is is probably that the So my next question was "is this a standardised thing", and the answer is yes. https://drafts.csswg.org/css-backgrounds-3/#body-background
There is, unfortunately, no way to replicate this behaviour in CSS while setting default values... If we set a default on This has nothing to do with the use of pseudo-elements, But the real question is is this acceptable? I'm really not sure, I do think that setting a default on But yeah, perhaps the best solution would be to petition W3C to make white the standard background xD different colours always break websites and yet browsers still use them because... reasons! |
@Pizzacus I decided to test it this way because I tried to use it on a login modal I was working on, and the login modal did not take up the whole screen obviously, then the background started acting weird. |
So I wanted to suggest this because as it turns out, some browsers don't set the body's background to
#FFFFFF
or its colour to#000000
by default, this can happen on some browser themes or if the user set their own colours.And this breaks many many websites, but many people who use settings and themes like that blame it on the devs of the website.
Since not a lot of devs are aware of this and yet most people would want to have a reliable background and text colour, maybe it would be a good idea to add
Since
:root
has the lowest CSS priority, it should not break anything, most people apply the background onhtml
orbody
anyway.I don't wanna debate on if those people are right or wrong to change their default background and text colour, there is also no actual HTML or CSS standards saying browsers should set the background to a certain colour as far as I'm aware, so it's not like they're 100% wrong.
I am not sure if this is in the minimalistic scope of your project, I do feel like it is because it is a very elemental reset that you could argue would help many websites out there. And that, if more people were aware of this, everyone would start their project by resetting the background and text colour.
The text was updated successfully, but these errors were encountered: