Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light switch #464

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ gh_edit_branch: "master" # the branch that your docs is served from
# gh_edit_source: docs # the source that your files originate from
gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately

# Color scheme currently only supports "dark", "light"/nil (default), or a custom scheme that you define
color_scheme: nil
# Color scheme supports "dark", "light"/nil (default), or a custom scheme that you define
# The scheme "light-or-dark" switches between "light" and "dark" with the system setting
color_scheme: light-or-dark

# Google Analytics Tracking (optional)
# e.g, UA-1234567-89
Expand Down
10 changes: 10 additions & 0 deletions _includes/css/just-the-docs.scss.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@charset "UTF-8";
{% if site.logo %}
$logo: "{{ site.logo | absolute_url }}";
{% endif %}
@import "./support/support";
{% if include.color_scheme == "light-or-dark" %}
@import "./color_schemes/light";
@import "./modules";
@media (prefers-color-scheme: dark) {
@import "./color_schemes/dark";
@import "./modules";
}
{% else %}
@import "./color_schemes/{{ include.color_scheme }}";
@import "./modules";
{% endif %}
{% include css/custom.scss.liquid %}
207 changes: 0 additions & 207 deletions _sass/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,213 +109,6 @@ figure.highlight {
}
}

.highlight .c {
color: #586e75;
} // comment //
.highlight .err {
color: #93a1a1;
} // error //
.highlight .g {
color: #93a1a1;
} // generic //
.highlight .k {
color: #859900;
} // keyword //
.highlight .l {
color: #93a1a1;
} // literal //
.highlight .n {
color: #93a1a1;
} // name //
.highlight .o {
color: #859900;
} // operator //
.highlight .x {
color: #cb4b16;
} // other //
.highlight .p {
color: #93a1a1;
} // punctuation //
.highlight .cm {
color: #586e75;
} // comment.multiline //
.highlight .cp {
color: #859900;
} // comment.preproc //
.highlight .c1 {
color: #586e75;
} // comment.single //
.highlight .cs {
color: #859900;
} // comment.special //
.highlight .gd {
color: #2aa198;
} // generic.deleted //
.highlight .ge {
font-style: italic;
color: #93a1a1;
} // generic.emph //
.highlight .gr {
color: #dc322f;
} // generic.error //
.highlight .gh {
color: #cb4b16;
} // generic.heading //
.highlight .gi {
color: #859900;
} // generic.inserted //
.highlight .go {
color: #93a1a1;
} // generic.output //
.highlight .gp {
color: #93a1a1;
} // generic.prompt //
.highlight .gs {
font-weight: bold;
color: #93a1a1;
} // generic.strong //
.highlight .gu {
color: #cb4b16;
} // generic.subheading //
.highlight .gt {
color: #93a1a1;
} // generic.traceback //
.highlight .kc {
color: #cb4b16;
} // keyword.constant //
.highlight .kd {
color: #268bd2;
} // keyword.declaration //
.highlight .kn {
color: #859900;
} // keyword.namespace //
.highlight .kp {
color: #859900;
} // keyword.pseudo //
.highlight .kr {
color: #268bd2;
} // keyword.reserved //
.highlight .kt {
color: #dc322f;
} // keyword.type //
.highlight .ld {
color: #93a1a1;
} // literal.date //
.highlight .m {
color: #2aa198;
} // literal.number //
.highlight .s {
color: #2aa198;
} // literal.string //
.highlight .na {
color: #555;
} // name.attribute //
.highlight .nb {
color: #b58900;
} // name.builtin //
.highlight .nc {
color: #268bd2;
} // name.class //
.highlight .no {
color: #cb4b16;
} // name.constant //
.highlight .nd {
color: #268bd2;
} // name.decorator //
.highlight .ni {
color: #cb4b16;
} // name.entity //
.highlight .ne {
color: #cb4b16;
} // name.exception //
.highlight .nf {
color: #268bd2;
} // name.function //
.highlight .nl {
color: #555;
} // name.label //
.highlight .nn {
color: #93a1a1;
} // name.namespace //
.highlight .nx {
color: #555;
} // name.other //
.highlight .py {
color: #93a1a1;
} // name.property //
.highlight .nt {
color: #268bd2;
} // name.tag //
.highlight .nv {
color: #268bd2;
} // name.variable //
.highlight .ow {
color: #859900;
} // operator.word //
.highlight .w {
color: #93a1a1;
} // text.whitespace //
.highlight .mf {
color: #2aa198;
} // literal.number.float //
.highlight .mh {
color: #2aa198;
} // literal.number.hex //
.highlight .mi {
color: #2aa198;
} // literal.number.integer //
.highlight .mo {
color: #2aa198;
} // literal.number.oct //
.highlight .sb {
color: #586e75;
} // literal.string.backtick //
.highlight .sc {
color: #2aa198;
} // literal.string.char //
.highlight .sd {
color: #93a1a1;
} // literal.string.doc //
.highlight .s2 {
color: #2aa198;
} // literal.string.double //
.highlight .se {
color: #cb4b16;
} // literal.string.escape //
.highlight .sh {
color: #93a1a1;
} // literal.string.heredoc //
.highlight .si {
color: #2aa198;
} // literal.string.interpol //
.highlight .sx {
color: #2aa198;
} // literal.string.other //
.highlight .sr {
color: #dc322f;
} // literal.string.regex //
.highlight .s1 {
color: #2aa198;
} // literal.string.single //
.highlight .ss {
color: #2aa198;
} // literal.string.symbol //
.highlight .bp {
color: #268bd2;
} // name.builtin.pseudo //
.highlight .vc {
color: #268bd2;
} // name.variable.class //
.highlight .vg {
color: #268bd2;
} // name.variable.global //
.highlight .vi {
color: #268bd2;
} // name.variable.instance //
.highlight .il {
color: #2aa198;
} // literal.number.integer.long //

//
// Code examples (rendered)
//
Expand Down
14 changes: 13 additions & 1 deletion _sass/color_schemes/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ $link-color: $blue-000;
$btn-primary-color: $blue-200;
$base-button-color: $grey-dk-250;

$code-background-color: $grey-dk-250;
$search-background-color: $grey-dk-250;
$table-background-color: $grey-dk-250;
$feedback-color: darken($sidebar-color, 3%);

//
// Both the following highlight themes are more legible than those used forthe light theme
//

@import "./vendor/pygments/css-github/pygments-tomorrow-night";
$code-background-color: #1d1f21;

// @import "./vendor/pygments/css-github/pygments-base16-tomorrow-dark";
// $code-background-color: #1d1f21;

// See ./vendor/pygments/ for alternative highlighting themes.
// When changing, $code-background-color may need adjusting.
Loading