-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#398) Ensure Disqus works in dark mode
Due to the Bootstrap upgrade to 5.3, Disqus comments were not readable in dark mode. This issue was reported and confirmed at: https://disqus.com/home/discussion/channel-discussdisqus/embed_disqus_comments_not_changing_background_color_with_bootstrap_53_color_mode/ A change has been made to override the color-scheme at the :root, which appears not to affect anything else in choco-theme currently. In addition, the Disqus JavaScript has been moved into it's own file so that the code can be shared across repositories.
- Loading branch information
Showing
13 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"corepack", | ||
"cssnano", | ||
"datatables", | ||
"Disqus", | ||
"DOCSEARCH", | ||
"dropoverlay", | ||
"easymde", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*! | ||
* choco-theme v0.6.2 (https://github.com/chocolatey/choco-theme#readme) | ||
* Copyright 2020-2024 Chocolatey Software | ||
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE) | ||
*/ | ||
(() => { | ||
// js/disqus.js | ||
(() => { | ||
const disqusShortname = "chocolatey"; | ||
const dsq = document.createElement("script"); | ||
dsq.type = "text/javascript"; | ||
dsq.async = true; | ||
dsq.src = `//${disqusShortname}.disqus.com/embed.js`; | ||
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq); | ||
document.addEventListener("themeChanged", () => { | ||
if (document.readyState == "complete") { | ||
DISQUS.reset({ reload: true, config: disqus_config }); | ||
} | ||
}); | ||
})(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*! | ||
* choco-theme v0.6.2 (https://github.com/chocolatey/choco-theme#readme) | ||
* Copyright 2020-2024 Chocolatey Software | ||
* Licensed under MIT (https://github.com/chocolatey/choco-theme/blob/main/LICENSE) | ||
*/ | ||
(()=>{(()=>{let t="chocolatey",e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=`//${t}.disqus.com/embed.js`,(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(e),document.addEventListener("themeChanged",()=>{document.readyState=="complete"&&DISQUS.reset({reload:!0,config:disqus_config})})})();})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(() => { | ||
const disqusShortname = 'chocolatey'; | ||
|
||
const dsq = document.createElement('script'); | ||
dsq.type = 'text/javascript'; | ||
dsq.async = true; | ||
dsq.src = `//${disqusShortname}.disqus.com/embed.js`; | ||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | ||
|
||
// Disqus theme switching | ||
// Tutorial: https://thisdevbrain.com/disqus-auto-theme-switching/ | ||
document.addEventListener('themeChanged', () => { | ||
if (document.readyState == 'complete') { | ||
// eslint-disable-next-line no-undef, camelcase | ||
DISQUS.reset({ reload: true, config: disqus_config }); | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters