From cba53a69145580ea948133412f1baefd264b9150 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 09:48:57 +0200 Subject: [PATCH 001/177] Make themes more customizable (cherry picked from commit dffb2706a158784e2f3091f895a868e373683bc8) --- .stylelintrc.json | 4 +- _config.yml | 2 +- _includes/head.html | 6 ++- _sass/color_schemes/dark.scss | 1 + _sass/color_schemes/light.scss | 1 + .../modules.scss | 21 +-------- assets/css/just-the-docs-dark.scss | 5 +++ assets/css/just-the-docs-light.scss | 5 +++ assets/css/just-the-docs.scss | 44 ------------------- assets/js/just-the-docs.js | 14 ++++++ docs/configuration.md | 11 ++--- docs/customization.md | 11 ++--- 12 files changed, 44 insertions(+), 81 deletions(-) create mode 100644 _sass/color_schemes/light.scss rename assets/css/dark-mode-preview.scss => _sass/modules.scss (54%) create mode 100644 assets/css/just-the-docs-dark.scss create mode 100644 assets/css/just-the-docs-light.scss delete mode 100644 assets/css/just-the-docs.scss diff --git a/.stylelintrc.json b/.stylelintrc.json index 108fc51..2253e64 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,7 +1,7 @@ { "ignoreFiles" : [ - "assets/css/just-the-docs.scss", - "assets/css/dark-mode-preview.scss", + "assets/css/just-the-docs-light.scss", + "assets/css/just-the-docs-dark.scss", "_sass/vendor/**/*.scss" ], "extends": [ diff --git a/_config.yml b/_config.yml index d12d439..17441c0 100644 --- a/_config.yml +++ b/_config.yml @@ -35,7 +35,7 @@ aux_links: # Footer content appears at the bottom of every page's main content footer_content: "Copyright © 2017-2019 Patrick Marsceill. Distributed by an MIT license." -# Color scheme currently only supports "dark" or nil (default) +# Color scheme currently only supports "dark" or "light"/nil (default) color_scheme: nil # Google Analytics Tracking (optional) diff --git a/_includes/head.html b/_includes/head.html index eae6a5e..f7ab6ed 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -12,7 +12,11 @@ - + {% assign color_scheme = site.color_scheme %} + {% if color_theme == nil %} + {% assign color_scheme = 'light' %} + {% endif %} + {% if site.ga_tracking != nil %} diff --git a/_sass/color_schemes/dark.scss b/_sass/color_schemes/dark.scss index f0e6505..333c2b1 100644 --- a/_sass/color_schemes/dark.scss +++ b/_sass/color_schemes/dark.scss @@ -1,3 +1,4 @@ +// override this file to change the dark theme $body-background-color: $grey-dk-300; $sidebar-color: $grey-dk-300; diff --git a/_sass/color_schemes/light.scss b/_sass/color_schemes/light.scss new file mode 100644 index 0000000..e9624b3 --- /dev/null +++ b/_sass/color_schemes/light.scss @@ -0,0 +1 @@ +// override this file to change the light (default) theme \ No newline at end of file diff --git a/assets/css/dark-mode-preview.scss b/_sass/modules.scss similarity index 54% rename from assets/css/dark-mode-preview.scss rename to _sass/modules.scss index 8b77da6..c0b017b 100644 --- a/assets/css/dark-mode-preview.scss +++ b/_sass/modules.scss @@ -1,28 +1,11 @@ ---- -# this ensures Jekyll reads the file to be transformed into CSS later -# only Main files contain this front matter, not partials. ---- - // // Import external dependencies // - @import "./vendor/normalize.scss/normalize.scss"; // -// Import Just the Docs scss -// - -// Support -@import "./support/support"; - -// -// Import custom color scheme scss -// - -@import "./color_schemes/dark.scss"; - // Modules +// @import "./base"; @import "./layout"; @import "./content"; @@ -38,4 +21,4 @@ // // Import custom overrides // -@import "./custom/custom"; +@import "./custom/custom"; \ No newline at end of file diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss new file mode 100644 index 0000000..a19ffc7 --- /dev/null +++ b/assets/css/just-the-docs-dark.scss @@ -0,0 +1,5 @@ +--- +--- +@import "./support/support"; +@import "./color_schemes/dark"; +@import "./modules"; \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss new file mode 100644 index 0000000..c32b314 --- /dev/null +++ b/assets/css/just-the-docs-light.scss @@ -0,0 +1,5 @@ +--- +--- +@import "./support/support"; +@import "./color_schemes/light"; +@import "./modules"; diff --git a/assets/css/just-the-docs.scss b/assets/css/just-the-docs.scss deleted file mode 100644 index 6a2eefa..0000000 --- a/assets/css/just-the-docs.scss +++ /dev/null @@ -1,44 +0,0 @@ ---- -# this ensures Jekyll reads the file to be transformed into CSS later -# only Main files contain this front matter, not partials. ---- - -// -// Import external dependencies -// - -@import "./vendor/normalize.scss/normalize.scss"; - -// -// Import Just the Docs scss -// - -// Support -@import "./support/support"; - -// -// Import custom overrides -// - -@import "./custom/custom"; - -// -// Import custom color scheme scss -// - -{% if site.color_scheme == "dark" %} -@import "./color_schemes/dark.scss"; -{% endif %} - -// Modules -@import "./base"; -@import "./layout"; -@import "./content"; -@import "./navigation"; -@import "./typography"; -@import "./labels"; -@import "./buttons"; -@import "./search"; -@import "./tables"; -@import "./code"; -@import "./utilities/utilities"; diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js index aadbf82..c765a9b 100644 --- a/assets/js/just-the-docs.js +++ b/assets/js/just-the-docs.js @@ -274,11 +274,25 @@ function initSearch() { } } +// Focus + function pageFocus() { var mainContent = document.querySelector('.js-main-content'); mainContent.focus(); } +// Switch theme + +jtd.getTheme = function() { + var cssFileHref = document.querySelector('[rel="stylesheet"]').getAttribute('href'); + return cssFileHref.substring(cssFileHref.lastIndexOf('-') + 1, cssFileHref.length - 4); +} + +jtd.setTheme = function(theme) { + var cssFile = document.querySelector('[rel="stylesheet"]'); + cssFile.setAttribute('href', '{{ "assets/css/just-the-docs-" | absolute_url }}' + theme + '.css'); +} + // Document ready jtd.onReady(function(){ diff --git a/docs/configuration.md b/docs/configuration.md index 14422fd..cb00b1a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -67,17 +67,14 @@ color_scheme: "dark" See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more information. diff --git a/docs/customization.md b/docs/customization.md index eccb4bc..6f715bf 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -36,17 +36,14 @@ color_scheme: "dark" ## Specific visual customization From f61b836f6e836595cd3979a5fc22eeedc17b01d8 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 10:05:56 +0200 Subject: [PATCH 002/177] Fixed stylesheet link (cherry picked from commit ac42a41ae3e36b002df52882be296c01873c0e5b) --- _includes/head.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index f7ab6ed..e640f97 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -12,9 +12,10 @@ - {% assign color_scheme = site.color_scheme %} - {% if color_theme == nil %} + {% if site.color_scheme == nil or site.color_scheme == "nil" %} {% assign color_scheme = 'light' %} + {% else %} + {% assign color_scheme = site.color_scheme %} {% endif %} From da50250f47d74350d0cf1bba11aff6fc3cfb3e49 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Mon, 20 May 2019 10:16:30 +0200 Subject: [PATCH 003/177] Fixed custom css (cherry picked from commit 7df9af5ab1f4b7f1c286d176a8b24be9d3ce8063) --- _sass/modules.scss | 7 +------ assets/css/just-the-docs-dark.scss | 3 ++- assets/css/just-the-docs-light.scss | 1 + 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/_sass/modules.scss b/_sass/modules.scss index c0b017b..4b1f129 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -16,9 +16,4 @@ @import "./search"; @import "./tables"; @import "./code"; -@import "./utilities/utilities"; - -// -// Import custom overrides -// -@import "./custom/custom"; \ No newline at end of file +@import "./utilities/utilities"; \ No newline at end of file diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index a19ffc7..8a5b8f7 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -2,4 +2,5 @@ --- @import "./support/support"; @import "./color_schemes/dark"; -@import "./modules"; \ No newline at end of file +@import "./modules"; +@import "./custom/custom"; \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index c32b314..997198e 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -3,3 +3,4 @@ @import "./support/support"; @import "./color_schemes/light"; @import "./modules"; +@import "./custom/custom"; From 5f0de692bec814a7c9d4441adc2474ae73080431 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 15 Aug 2019 18:44:10 +0200 Subject: [PATCH 004/177] Fixed css style --- _sass/color_schemes/light.scss | 2 +- _sass/modules.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_sass/color_schemes/light.scss b/_sass/color_schemes/light.scss index e9624b3..5932f29 100644 --- a/_sass/color_schemes/light.scss +++ b/_sass/color_schemes/light.scss @@ -1 +1 @@ -// override this file to change the light (default) theme \ No newline at end of file +// override this file to change the light (default) theme diff --git a/_sass/modules.scss b/_sass/modules.scss index 4b1f129..dc94a4b 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -16,4 +16,4 @@ @import "./search"; @import "./tables"; @import "./code"; -@import "./utilities/utilities"; \ No newline at end of file +@import "./utilities/utilities"; From 9e0bc86dbe3d2870d534dae6c61b7d116f6b02d0 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 20:06:45 +0200 Subject: [PATCH 005/177] Simplified css color schemes (cherry picked from commit 52b0bced5d235d7557413e064f3841ea774d9063) --- _includes/css/just-the-docs.scss | 3 +++ _sass/modules.scss | 1 + assets/css/just-the-docs-dark.scss | 5 +---- assets/css/just-the-docs-light.scss | 5 +---- 4 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 _includes/css/just-the-docs.scss diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss new file mode 100644 index 0000000..61c8c2e --- /dev/null +++ b/_includes/css/just-the-docs.scss @@ -0,0 +1,3 @@ +@import "./support/support"; +@import "./color_schemes/{{ include.color_scheme }}"; +@import "./modules"; diff --git a/_sass/modules.scss b/_sass/modules.scss index dc94a4b..30f1f2a 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -17,3 +17,4 @@ @import "./tables"; @import "./code"; @import "./utilities/utilities"; +@import "./custom/custom"; diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index 8a5b8f7..c44bde1 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,6 +1,3 @@ --- --- -@import "./support/support"; -@import "./color_schemes/dark"; -@import "./modules"; -@import "./custom/custom"; \ No newline at end of file +{% include css/just-the-docs.scss color_scheme="dark" %} \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index 997198e..a5aab89 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,6 +1,3 @@ --- --- -@import "./support/support"; -@import "./color_schemes/light"; -@import "./modules"; -@import "./custom/custom"; +{% include css/just-the-docs.scss color_scheme="light" %} \ No newline at end of file From 6c569cbdc253b886b230cd80f39d9f54fce66254 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 22:04:17 +0200 Subject: [PATCH 006/177] Fixed custom css (cherry picked from commit bab3437a1feefc49213e1e787db0451491aca9b9) --- _includes/css/just-the-docs.scss | 1 + _sass/modules.scss | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss index 61c8c2e..ee779b2 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss @@ -1,3 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; +@import "./custom/custom"; diff --git a/_sass/modules.scss b/_sass/modules.scss index 30f1f2a..dc94a4b 100644 --- a/_sass/modules.scss +++ b/_sass/modules.scss @@ -17,4 +17,3 @@ @import "./tables"; @import "./code"; @import "./utilities/utilities"; -@import "./custom/custom"; From 3995fbfc3559cbe33dc778f5cca818b6dd2bc4fa Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 20 Jul 2019 22:11:41 +0200 Subject: [PATCH 007/177] More customizable css (cherry picked from commit 8aa0899facd01f689692fccdb338673f5e9a9fbd) --- _includes/css/custom.scss | 1 + _includes/css/just-the-docs.scss | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 _includes/css/custom.scss diff --git a/_includes/css/custom.scss b/_includes/css/custom.scss new file mode 100644 index 0000000..2ad1576 --- /dev/null +++ b/_includes/css/custom.scss @@ -0,0 +1 @@ +@import "./custom/custom"; diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss index ee779b2..9c27ce6 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss @@ -1,4 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; -@import "./custom/custom"; +{% include css/custom.scss %} From 2febd256db056b73ef06992fb9788c9ded4a29da Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 17:00:21 +0200 Subject: [PATCH 008/177] Added .liquid suffix to included scss files (cherry picked from commit 7fb79c2018b979fdf917f427ca5d3f2451f3265d) --- _includes/css/{custom.scss => custom.scss.liquid} | 0 _includes/css/{just-the-docs.scss => just-the-docs.scss.liquid} | 2 +- assets/css/just-the-docs-dark.scss | 2 +- assets/css/just-the-docs-light.scss | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename _includes/css/{custom.scss => custom.scss.liquid} (100%) rename _includes/css/{just-the-docs.scss => just-the-docs.scss.liquid} (73%) diff --git a/_includes/css/custom.scss b/_includes/css/custom.scss.liquid similarity index 100% rename from _includes/css/custom.scss rename to _includes/css/custom.scss.liquid diff --git a/_includes/css/just-the-docs.scss b/_includes/css/just-the-docs.scss.liquid similarity index 73% rename from _includes/css/just-the-docs.scss rename to _includes/css/just-the-docs.scss.liquid index 9c27ce6..2fc1e27 100644 --- a/_includes/css/just-the-docs.scss +++ b/_includes/css/just-the-docs.scss.liquid @@ -1,4 +1,4 @@ @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; -{% include css/custom.scss %} +{% include css/custom.scss.liquid %} diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index c44bde1..3f5bd6b 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss color_scheme="dark" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="dark" %} \ No newline at end of file diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index a5aab89..336d74e 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss color_scheme="light" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="light" %} \ No newline at end of file From d549d37e6faac68cfeba7cec13e35d306d47fee5 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 15 Aug 2019 20:12:57 +0200 Subject: [PATCH 009/177] Fixed missing new lines --- _includes/title.html | 2 +- _layouts/table_wrappers.html | 2 +- assets/css/just-the-docs-dark.scss | 2 +- assets/css/just-the-docs-light.scss | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_includes/title.html b/_includes/title.html index f6d5669..35b2c6c 100644 --- a/_includes/title.html +++ b/_includes/title.html @@ -1 +1 @@ -{{ site.title }} \ No newline at end of file +{{ site.title }} diff --git a/_layouts/table_wrappers.html b/_layouts/table_wrappers.html index cc6187a..3f8f226 100644 --- a/_layouts/table_wrappers.html +++ b/_layouts/table_wrappers.html @@ -4,4 +4,4 @@ layout: vendor/compress {% assign content_ = content | replace: '', '' %} -{{ content_ }} \ No newline at end of file +{{ content_ }} diff --git a/assets/css/just-the-docs-dark.scss b/assets/css/just-the-docs-dark.scss index 3f5bd6b..ac92fb1 100644 --- a/assets/css/just-the-docs-dark.scss +++ b/assets/css/just-the-docs-dark.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss.liquid color_scheme="dark" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="dark" %} diff --git a/assets/css/just-the-docs-light.scss b/assets/css/just-the-docs-light.scss index 336d74e..ac69688 100644 --- a/assets/css/just-the-docs-light.scss +++ b/assets/css/just-the-docs-light.scss @@ -1,3 +1,3 @@ --- --- -{% include css/just-the-docs.scss.liquid color_scheme="light" %} \ No newline at end of file +{% include css/just-the-docs.scss.liquid color_scheme="light" %} From ee8b901bcbc5db0596d8b6e98f5bd34f4dc75d66 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 14:36:51 +0200 Subject: [PATCH 010/177] Simplified nav nesting (cherry picked from commit eeb3f342b17a744d0c2b2f0360359fa3276f8abd) --- _includes/nav.html | 78 +++++++++++++++++++++---------------------- _layouts/default.html | 7 ++-- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/_includes/nav.html b/_includes/nav.html index d561a42..fbe159f 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,40 +1,38 @@ - + diff --git a/_layouts/default.html b/_layouts/default.html index d414234..52a03e1 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -4,7 +4,7 @@ layout: table_wrappers - + {% include head.html %} @@ -14,10 +14,9 @@ layout: table_wrappers {% include title.html %} - - +

This site uses Just the Docs, a documentation theme for Jekyll.

From 183778067bfec16cc2ed4c7ba9f4ed1aa3c66496 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Thu, 15 Aug 2019 22:56:24 +0200 Subject: [PATCH 011/177] Fixed missing closing div in default.html, formatting --- _layouts/default.html | 53 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index 52a03e1..a8bc48c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -25,13 +25,13 @@ layout: table_wrappers
From 721ca36d85a85d033f6e5da01ab9f7dbaf41428c Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 21 Jul 2019 16:09:29 +0200 Subject: [PATCH 012/177] Cleaned ids and classes (cherry picked from commit 2b153ed074811e735aaa58d57a3fcdf7838e17f5) --- _layouts/default.html | 18 +++++++++--------- _sass/content.scss | 2 +- _sass/layout.scss | 20 ++++++++++---------- _sass/navigation.scss | 2 +- _sass/search.scss | 2 +- assets/js/just-the-docs.js | 18 +++++++++--------- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/_layouts/default.html b/_layouts/default.html index a8bc48c..8bf647d 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -12,25 +12,25 @@ layout: table_wrappers -
-
-