Skip to content

Commit

Permalink
fix: correct regression with code highlighting in dark mode (#760)
Browse files Browse the repository at this point in the history
### Prerequisites

Put an `x` into the box(es) that apply:

- [x] This pull request fixes a bug.
- [ ] This pull request adds a feature.
- [ ] This pull request introduces breaking change.

### Description

This PR reverts a regression error in which the foreground color
specified for highlighted code is almost indistinguishable from the
white background used in dark mode.

This was originally fixed in 29a7a94 / #630 by assigning `color:
$fg-color` from the light scheme variables (resolves to `#212121`). In
476429d, the assignment was changed to `$fg-color-dark` (resolves to
`#dadada`) but this resulted in a color that is too close to the white
of the code highlight to be read easily. See image:

<img width="892" alt="SCR-20230107-rqc"
src="https://user-images.githubusercontent.com/11639356/211178462-f9c0fa4a-e29a-4a40-82ae-10580da2f112.png">

This fix assigns `$bg-color-dark` which resolves to `#212121` (same as
the original fix). With this change applied, the code is now legible:

<img width="899" alt="SCR-20230107-rol"
src="https://user-images.githubusercontent.com/11639356/211178461-10b64d47-4eeb-4959-9c87-59af94201e29.png">

### Issues Resolved

N/A

### Checklist

Put an `x` into the box(es) that apply:

#### General

- [x] Describe what changes are being made
- [x] Explain why and how the changes were necessary and implemented
respectively
- [ ] Reference issue with `#<ISSUE_NO>` if applicable

#### Resources

- [x] If you have changed any SCSS code, run `make release` to
regenerate all CSS files

#### Contributors

- [x] Add yourself to `CONTRIBUTORS.md` if you aren't on it already
  • Loading branch information
robertwtucker committed Jan 10, 2023
1 parent 473ff71 commit 6407a20
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@
- [Brian Lachniet](https://github.com/blachniet)
- [ShortArrow](https://github.com/ShortArrow)
- [Martin Hellspong](https://github.com/marhel)
- [Robert Tucker](https://github.com/robertwtucker)
2 changes: 1 addition & 1 deletion assets/scss/_base_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
.highlight {
pre {
background-color: $alt-bg-color-dark;
color: $fg-color-dark;
color: $bg-color-dark;

code {
background-color: inherit;
Expand Down

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/coder-dark.min.593028e7f7ac55c003b79c230d1cd411bb4ca53b31556c3abb7f027170e646e9.css","MediaType":"text/css","Data":{"Integrity":"sha256-WTAo5/esVcADt5wjDRzUEbtMpTsxVWw6u38CcXDmRuk="}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Target":"css/coder.min.36f76aaf39a14ecf5c3a3c6250dcaf06c238b3d8365d17d646f95cb1874e852b.css","MediaType":"text/css","Data":{"Integrity":"sha256-NvdqrzmhTs9cOjxiUNyvBsI4s9g2XRfWRvlcsYdOhSs="}}

This file was deleted.

0 comments on commit 6407a20

Please sign in to comment.