This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.3] Blob view: bandaid selection coloring #60354
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Codemirror applies its own styling for selections, and when the blob view is focused, that styling is higher precedence than the overrides we provide. More confusingly, sometimes (it's not deterministic) the codemirror styling does not respect the light/dark theme settings, which makes selection look very broken. It's still not clear to me why the theme variable is not being respected, but given our proximity to code freeze, this just adds an
!important
to our theme overrides to make it not feel super broken.Slack thread
Before:

A capture of the CSS selector that was problematic:
<img width="479" alt="image" src="https://github.com/sourcegraph/sourcegraph/assets/12631702/59cfa635-fe7c-44e6-9fa9-4d5c0c7828b8">
Test plan
Visually checked that there are no more dark backgrounds and opened the console to double check that the
!important
was showing up and causing that style to apply at higher precedence than the built-in themesBackport 8d5e4a5 from #60344