mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Fix darkmode mermaid theme
* See: https://github.com/next-theme/hexo-theme-next/issues/331
This commit is contained in:
parent
0005c0367f
commit
debbe5bdc9
@ -815,7 +815,9 @@ pdf:
|
|||||||
mermaid:
|
mermaid:
|
||||||
enable: false
|
enable: false
|
||||||
# Available themes: default | dark | forest | neutral
|
# Available themes: default | dark | forest | neutral
|
||||||
theme: forest
|
theme:
|
||||||
|
light: default
|
||||||
|
dark: dark
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
|
|||||||
@ -14,6 +14,7 @@ hexo.extend.helper.register('next_config', function() {
|
|||||||
root : config.root,
|
root : config.root,
|
||||||
images : url_for(theme.images),
|
images : url_for(theme.images),
|
||||||
scheme : theme.scheme,
|
scheme : theme.scheme,
|
||||||
|
darkmode : theme.darkmode,
|
||||||
version : this.next_version,
|
version : this.next_version,
|
||||||
exturl : theme.exturl,
|
exturl : theme.exturl,
|
||||||
sidebar : theme.sidebar,
|
sidebar : theme.sidebar,
|
||||||
|
|||||||
10
source/js/third-party/tags/mermaid.js
vendored
10
source/js/third-party/tags/mermaid.js
vendored
@ -12,14 +12,14 @@ document.addEventListener('page:loaded', () => {
|
|||||||
newElement.className = element.className;
|
newElement.className = element.className;
|
||||||
element.parentNode.replaceChild(newElement, element);
|
element.parentNode.replaceChild(newElement, element);
|
||||||
});
|
});
|
||||||
|
mermaid.initialize({
|
||||||
mermaid.init({
|
theme : CONFIG.darkmode && window.matchMedia('(prefers-color-scheme: dark)').matches ? CONFIG.mermaid.theme.dark : CONFIG.mermaid.theme.light,
|
||||||
theme : CONFIG.mermaid.theme,
|
logLevel : 4,
|
||||||
logLevel : 3,
|
|
||||||
flowchart: { curve: 'linear' },
|
flowchart: { curve: 'linear' },
|
||||||
gantt : { axisFormat: '%m/%d/%Y' },
|
gantt : { axisFormat: '%m/%d/%Y' },
|
||||||
sequence : { actorMargin: 50 }
|
sequence : { actorMargin: 50 }
|
||||||
}, '.mermaid');
|
});
|
||||||
|
mermaid.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user