Skip to content

Commit

Permalink
Fix default highlighting in custom color schemes (mmistakes#986)
Browse files Browse the repository at this point in the history
* Fix default highlighting in custom schemes

Fix mmistakes#982

The variable settings for highlighting in the default `light` scheme are currently (v0.4.0.rc2`) in `_sass/color_schemes/light.scss`.
This PR ensures that custom schemes are based on the `light` scheme.

It also adds a note explaining the default to the customization docs,
and gives an example of how to define a custom scheme based on the `dark` scheme

* Prettier

* Deleted test file

Co-authored-by: Matt Wang <matt@matthewwang.me>
  • Loading branch information
pdmosses and mattxwang authored Sep 29, 2022
1 parent f1fd81d commit 33a7b2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions _includes/css/just-the-docs.scss.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
$logo: "{{ site.logo | relative_url }}";
{% endif %}
@import "./support/support";
@import "./color_schemes/light";
@import "./color_schemes/{{ include.color_scheme }}";
@import "./modules";
{% include css/custom.scss.liquid %}
Expand Down
11 changes: 11 additions & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ You can add custom schemes.
If you want to add a scheme named `foo` (can be any name) just add a file `_sass/color_schemes/foo.scss` (replace `foo` by your scheme name)
where you override theme variables to change colors, fonts, spacing, etc.

{: .note }
Since the default color scheme is `light`, your custom scheme is implicitly based on the variable settings used by the `light` scheme.

If you want your custom scheme to be based on the `dark` scheme, you need to start your file with the following line:

```scss
@import "./color_schemes/dark";
```

You can define custom schemes based on other custom schemes in the same way.

Available variables are listed in the [\_variables.scss](https://github.com/just-the-docs/just-the-docs/tree/main/_sass/support/_variables.scss) file.

For example, to change the link color from the purple default to blue, include the following inside your scheme file:
Expand Down

0 comments on commit 33a7b2a

Please sign in to comment.