TLDR; I've encountered interesting behaviour in Firefox. For example, it automatically styles the scrollbar limegreen, but not lightgreen. Why does it render one, but not the other?
While answering another question I found that this renders a limegreen colored scroll bar in Firefox 72 latest on Windows 10:
div {
background-color: limegreen;
max-height: 5em;
overflow-y: scroll;
}
<div>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br></div>
Like this:
But that Firefox refuses to render a lightgreen colored scroll bar:
div {
background-color: lightgreen;
max-height: 5em;
overflow-y: scroll;
}
<div>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br>Hi!<br></div>
See this:
What causes this behavior, and how can I predict it?
PS. Chrome 80 shows both scrollbars in the default style.
PS. There are questions on how to actively change scrollbar color in Firefox, but I'm not (right now) interested in pragmatic advice on "how to change scrollbar color", but instead I'm asking and trying to understand when and why it happens automatically, and only for some background colors.