Skip to content

Commit

Permalink
Merge branch 'hibbitts-design:docsify-this-v1' into docsify-this-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhibbitts authored Jan 12, 2025
2 parents 325d3e0 + ead3b35 commit 757fa9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ https://docsify-this.net?basePath=https://raw.githubusercontent.com/hibbitts-des

##### dark-mode

Always enable dark theme or automatically switch light/dark theme based on system OS-level preference with the optional **dark-mode** parameter, for example:
Enable dark theme or automatically switch light/dark theme based on system OS-level preference with the optional **dark-mode** parameter, for example:
https://preview-v2.docsify-this.net/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-open-publishing-starter-kit/main/docs&homepage=introduction.md&dark-mode=on

##### edit-link-emoji
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ Page layout:
<hr>

<div class="docsifythisurlbuilderoptionsline"><div class='stackedlabeldropdown' style='margin-bottom:4px;border-radius: 7px;border-color: #8e8f9d'>
<label for="enableDarkmode">Dark mode:</label>
<label for="enableDarkmode">Dark theme mode:</label>
<select style="border-radius: 7px;border-color: #8e8f9d" class="docsifythisurlbuilderoptionsline" id="enableDarkmode" name="enableDarkmode">
<option value="false">Always Off</option>
<option value="false">Off</option>
<option disabled="disabled">----</option>
<option value="on">Always On</option>
<option value="on">On</option>
<option value="auto">Match System Setting</option>
</select>
</div></div>
Expand Down Expand Up @@ -575,7 +575,7 @@ https://docsify-this.net?basePath=https://raw.githubusercontent.com/hibbitts-des

##### dark-mode

Always enable dark theme or automatically switch light/dark theme based on system OS-level preference with the optional **dark-mode** parameter, for example:
Enable dark theme or automatically switch light/dark theme based on system OS-level preference with the optional **dark-mode** parameter, for example:
https://preview-v2.docsify-this.net/?basePath=https://raw.githubusercontent.com/hibbitts-design/docsify-open-publishing-starter-kit/main/docs&homepage=introduction.md&dark-mode=on

##### edit-link-emoji
Expand Down
16 changes: 8 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
href="https://docsify-themeable-preview.vercel.app/dist/css/theme-simple-dark.css">-->

<link rel="stylesheet"
href="assets/vendor/themeable/themes/preview/theme-simple-dark.css" data-sheet="dark-theme" disabled/>
href="assets/vendor/themeable/themes/preview/theme-simple-dark.css" data-sheet="dark-mode" disabled/>

<link rel="stylesheet" media="(prefers-color-scheme: dark)"
href="assets/vendor/themeable/themes/preview/theme-simple-dark.css" data-sheet="dark-theme-auto"/>
href="assets/vendor/themeable/themes/preview/theme-simple-dark.css" data-sheet="dark-mode-auto"/>

<link rel="stylesheet" href="assets/css/theme.css">

Expand Down Expand Up @@ -711,7 +711,7 @@
document.getElementById("coverpagecolor").value = '#6C8A9A';
document.getElementById("coverpagecolorpreview").style.borderColor = '#6C8A9A';
document.getElementById("coverpagecolorpreview").style.backgroundColor = '#6C8A9A';
document.getElementById("enableDarkmode").value = false;
document.getElementById("enableDarkmode").value = 'false';
document.getElementById("linkcolordarkmode").value = '#0374B5';
document.getElementById("linkcolordarkmodepreview").style.borderColor = '#0374B5';
document.getElementById("linkcolordarkmodepreview").style.backgroundColor = '#0374B5';
Expand Down Expand Up @@ -1021,7 +1021,7 @@
const embeds = Array.from(htmlElement.querySelectorAll('.embedly-card'))
if (!(embeds.length === 0)) {
var enabledarkmode = getURLParameterByName(['dark-mode', 'darkMode'], null, null, window.location.href, true);
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && enabledarkmode === 'auto') || enabledarkmode === 'on') {
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches && (enabledarkmode === 'auto') || (enabledarkmode === true)) || enabledarkmode === 'on') {
// dark mode
if (enabledarkmode || darkmode) {
embeds.forEach(embed => {
Expand Down Expand Up @@ -1838,12 +1838,12 @@
// Enable dark theme CSS files loaded if dark-mode parameter is true
var enabledarkmode = getURLParameterByName(['dark-mode', 'darkMode'], null, null, window.location.href, true);
if (enabledarkmode === 'auto' || enabledarkmode === 'true' || darkmode === 'auto' ) {
document.querySelector('link[data-sheet="dark-theme-auto"]').disabled = false;
document.querySelector('link[data-sheet="dark-mode-auto"]').disabled = false;
} else if (enabledarkmode === 'on' || darkmode === 'on' ) {
document.querySelector('link[data-sheet="dark-theme"]').disabled = false;
document.querySelector('link[data-sheet="dark-mode"]').disabled = false;
} else {
document.querySelector('link[data-sheet="dark-theme"]').disabled = true;
document.querySelector('link[data-sheet="dark-theme-auto"]').disabled = true;
document.querySelector('link[data-sheet="dark-mode"]').disabled = true;
document.querySelector('link[data-sheet="dark-mode-auto"]').disabled = true;
}

}
Expand Down

0 comments on commit 757fa9f

Please sign in to comment.