mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-10 14:01:22 -06:00
The scope of this PR has changed slightly - it now removes all styling of `::selection`, which reverts selected-element highlighting to browser defaults (typically a blue highlight with no text colour changes). It still inadvertently closes #1201. I've included the original PR body below: --- This resolves an issue on Firefox where selecting a code block produces white text on a white background, which is not legible. To test: visit https://deploy-preview-1208--just-the-docs.netlify.app/docs/index-test/, and highlight various code blocks in light/dark mode. I did a bit more digging, and realized a handful of things: - when I added the new `OneLightJekyll` theme, I inadvertently bundled in a `::selection` class; I've removed it. - I'm not really sure why this is a part of the theme in the first place! - this is technically the minimum change required to have no more issues - however, at this point, Firefox now correctly uses the global `::selection`, which is white-on-purple; this is *different* from Chrome, which somehow overrides this for `pre` or `code`; I also (subjectively) think this is harder to read. - the vast majority of websites default to the browser/user agent stylesheet for code highlighting; for example, [react.dev](https://react.dev) - so, I've elected to instead default to the browser/user agent stylesheet; this has the nice side effect of making Chrome and Firefox consistent again Questions for reviewers/community members: - does this fix the problem for you? what about other browsers? - do we like having the browser default for code selection, or should we stick to white-on-purple? Closes #1201.