Update default theme code highlighting with Atom's One Light colors, consolidate theme variables (#1166)

This PR replaces the default light code highlighting theme with Atom's One Light theme colors. This should provide more visual similarity with our dark theme, and as a byproduct, fix some of the contrast issues from our current light theme.

In addition (different from the original purpose of this PR), this also moves theme variables from `variables.scss` to `light.scss`, which always gets loaded anyways.

To test, compare the [deploy preview's kitchen sink Python code](https://deploy-preview-1166--just-the-docs.netlify.app/docs/index-test/#more-code) to the current [`main` branch's code](https://just-the-docs.github.io/just-the-docs/docs/index-test/#more-code); you can also use the "Preview dark color scheme" button to see OneDarkJekyll in action.

Users can opt-in to the old theme with `legacy_light`. I've documented this in the "customization" page.

Closes #679.

## implementation

Feel free to skip this part.

To do this, I:

- forked [mgyongyosi/OneDarkJekyll](https://github.com/mgyongyosi/OneDarkJekyll) to our own organization, [OneLightJekyll](https://github.com/just-the-docs/OneLightJekyll)
- updated the code to be slightly more robust (e.g. not require installing to global path)
- replaced the `colors.less` with the one pulled from Atom's [one-light-syntax](https://github.com/atom/atom/tree/master/packages/one-light-syntax)
- updated the license notice to also include GitHub's work in Atom
- regenerated the file
- plopped it in our current theme code



## next steps

This is related to #1100. I wanted to make this PR easier to review, so I won't implement that just yet; once we merge this, I can push that PR through. It's also related to #1173; in a comment below, I've also outlined some potential future work.

After we merge this, I'll trigger a release soon. I think this next minor bump can be focused on color schemes, e.g. dark theme, theme switching, and some bugfixes.
This commit is contained in:
Matt Wang
2023-03-08 15:11:41 -08:00
committed by GitHub
parent 67d7465dbe
commit 9a0b518f0e
8 changed files with 519 additions and 245 deletions

View File

@@ -45,6 +45,15 @@ jtd.addEvent(toggleDarkMode, 'click', function(){
});
</script>
### deprecated: `legacy_light`
{: .d-inline-block .no_toc }
New (v0.5.0)
{: .label .label-green }
In Just the Docs version `0.5.0`, we changed the default syntax highlighting theme for the `light` color scheme to have higher contrast. Users who are want to use the old highlighting need to explicitly opt-in with the deprecated `legacy_light` color scheme. In a future major release of Just the Docs, we will remove this color scheme.
## Custom schemes
### Define a custom scheme