fix mermaid

This commit is contained in:
Mivinci 2022-11-09 18:03:38 +08:00
parent 1105d5e939
commit 88481e9f0b
15 changed files with 59 additions and 47 deletions

View file

@ -53,16 +53,14 @@ function switch_minima_theme(current, next) {
/** @param {string} theme */
function switch_utterances_theme(theme) {
if (!utterances) {
utterances = document.querySelector('iframe.utterances-frame')
}
utterances =utterances || document.querySelector('iframe.utterances-frame')
if (!utterances) return
utterances.contentWindow.postMessage({ type: 'set-theme', theme }, 'https://utteranc.es')
}
/** @param {string} theme */
function switch_giscus_theme(theme) {
if (!giscus) {
giscus = document.querySelector('iframe.giscus-frame')
}
giscus = giscus || document.querySelector('iframe.giscus-frame')
if (!giscus) return
giscus.contentWindow.postMessage({giscus: {setConfig: {theme}}}, 'https://giscus.app')
}