mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-14 22:03:31 -06:00
Fix dark theme's code block background, line number colors (#1124)
When customizing `$code-background-color` in `dark.scss`, the result is a multi-color background. (see https://github.com/just-the-docs/just-the-docs/issues/1121#issuecomment-1374976843) This makes OneDarkJekyll code block colors the same as the specified `$code-background-color`, and uses the `$default-body-color` as the line number text color, which can otherwise be invisible due to the default being black and is hard to see on a very dark code block background.
This commit is contained in:
@@ -207,4 +207,21 @@ code.language-mermaid {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
// Override OneDarkJekyll Colors for Code Blocks
|
||||
.highlight,
|
||||
pre.highlight {
|
||||
background: $code-background-color; // Code Background
|
||||
// For Backwards Compatibility Before $code-linenumber-color was added
|
||||
@if variable-exists(code-linenumber-color) {
|
||||
color: $code-linenumber-color; // Code Line Numbers
|
||||
} @else {
|
||||
color: $body-text-color; // Code Line Numbers
|
||||
}
|
||||
}
|
||||
|
||||
// Override OneDarkJekyll Colors for Code Blocks
|
||||
.highlight pre {
|
||||
background: $code-background-color; // Code Background
|
||||
}
|
||||
|
||||
// {% endraw %}
|
||||
|
Reference in New Issue
Block a user