fix: Halo评论组件暗色模式
This commit is contained in:
parent
68b261dd1f
commit
bbffe461a7
|
@ -0,0 +1,12 @@
|
|||
let halo = {
|
||||
darkComment : ()=>{
|
||||
if(document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList != null){
|
||||
let commentDOMclass = document.querySelector('#comment div').shadowRoot.querySelector('.halo-comment-widget').classList
|
||||
if(commentDOMclass.contains('light'))
|
||||
commentDOMclass.replace('light','dark')
|
||||
else
|
||||
commentDOMclass.replace('dark','light')
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -205,6 +205,7 @@ rm.switchDarkMode = function () {
|
|||
navFn.switchDarkMode();
|
||||
rm.hideRightMenu();
|
||||
heo.darkModeStatus();
|
||||
halo.darkComment();
|
||||
}
|
||||
|
||||
rm.copyUrl = function (id) {
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name='links'"/>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name='links'" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
<script th:src="@{/assets/js/heo.js}"></script>
|
||||
|
||||
<script th:src="@{/assets/js/halo.js}"></script>
|
||||
|
||||
<link rel="stylesheet" th:href="@{/assets/zhheo/zhheoblog.css}">
|
||||
|
||||
<link rel="stylesheet" th:href="@{/assets/zhheo/custom.css}">
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage"
|
||||
th:attr="name=${singlePage.metadata.name}"/>
|
||||
th:attr="name=${singlePage.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}"/>
|
||||
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme') />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue