From 45cac6105e930fc98ec1622779ae68d1cbae020c Mon Sep 17 00:00:00 2001 From: Jelmer Borst Date: Sun, 9 Oct 2022 19:41:32 +0200 Subject: [PATCH] Have website use theme variables instead of custom SASS overrides (#285) --- website/_includes/head_custom.html | 4 ++-- website/_sass/color_schemes/_common.scss | 5 +++++ website/_sass/color_schemes/_variables.scss | 1 + website/_sass/color_schemes/eps-dark.scss | 3 +++ website/_sass/color_schemes/eps-light.scss | 3 +++ website/_sass/custom/custom.scss | 21 ------------------- .../assets/css/just-the-docs-eps-dark.scss | 3 +++ .../assets/css/just-the-docs-eps-light.scss | 3 +++ 8 files changed, 20 insertions(+), 23 deletions(-) create mode 100644 website/_sass/color_schemes/_common.scss create mode 100644 website/_sass/color_schemes/_variables.scss create mode 100644 website/_sass/color_schemes/eps-dark.scss create mode 100644 website/_sass/color_schemes/eps-light.scss delete mode 100644 website/_sass/custom/custom.scss create mode 100644 website/assets/css/just-the-docs-eps-dark.scss create mode 100644 website/assets/css/just-the-docs-eps-light.scss diff --git a/website/_includes/head_custom.html b/website/_includes/head_custom.html index 598920041f..74b77b7772 100644 --- a/website/_includes/head_custom.html +++ b/website/_includes/head_custom.html @@ -12,7 +12,7 @@ - - diff --git a/website/_sass/color_schemes/_common.scss b/website/_sass/color_schemes/_common.scss new file mode 100644 index 0000000000..477b57bec3 --- /dev/null +++ b/website/_sass/color_schemes/_common.scss @@ -0,0 +1,5 @@ +footer > img#logo { + width: 2rem; + margin: 0 auto; + display: block; +} diff --git a/website/_sass/color_schemes/_variables.scss b/website/_sass/color_schemes/_variables.scss new file mode 100644 index 0000000000..fb0a8addf8 --- /dev/null +++ b/website/_sass/color_schemes/_variables.scss @@ -0,0 +1 @@ +$nav-width: 400px; diff --git a/website/_sass/color_schemes/eps-dark.scss b/website/_sass/color_schemes/eps-dark.scss new file mode 100644 index 0000000000..67cf318f23 --- /dev/null +++ b/website/_sass/color_schemes/eps-dark.scss @@ -0,0 +1,3 @@ +@import "./color_schemes/dark"; +@import "_variables"; +@import "_common"; diff --git a/website/_sass/color_schemes/eps-light.scss b/website/_sass/color_schemes/eps-light.scss new file mode 100644 index 0000000000..9b8dfede4f --- /dev/null +++ b/website/_sass/color_schemes/eps-light.scss @@ -0,0 +1,3 @@ +@import "./color_schemes/light"; +@import "_variables"; +@import "_common"; diff --git a/website/_sass/custom/custom.scss b/website/_sass/custom/custom.scss deleted file mode 100644 index cff65e8ac6..0000000000 --- a/website/_sass/custom/custom.scss +++ /dev/null @@ -1,21 +0,0 @@ -// XXX: We should override `$nav-width(-md)`, but this breaks code highlighting -// and other styles. See -// https://github.com/just-the-docs/just-the-docs/issues/982. -// Once the fix for the above issue is released, replace this section with the -// approach recommended at -// https://just-the-docs.github.io/just-the-docs/docs/customization/#custom-schemes. -@include mq(lg) { - .side-bar { - min-width: 400px; - } - - .site-nav, .site-header { - width: 400px; - } -} - -footer > img#logo { - width: 2rem; - margin: 0 auto; - display: block; -} diff --git a/website/assets/css/just-the-docs-eps-dark.scss b/website/assets/css/just-the-docs-eps-dark.scss new file mode 100644 index 0000000000..2d7902cda4 --- /dev/null +++ b/website/assets/css/just-the-docs-eps-dark.scss @@ -0,0 +1,3 @@ +--- +--- +{% include css/just-the-docs.scss.liquid color_scheme="eps-dark" %} diff --git a/website/assets/css/just-the-docs-eps-light.scss b/website/assets/css/just-the-docs-eps-light.scss new file mode 100644 index 0000000000..90a89fd0f0 --- /dev/null +++ b/website/assets/css/just-the-docs-eps-light.scss @@ -0,0 +1,3 @@ +--- +--- +{% include css/just-the-docs.scss.liquid color_scheme="eps-light" %}