Skip to content

Commit

Permalink
fix: 修复评论组件和系统主题可能不一致的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
AirboZH committed Oct 12, 2023
1 parent 3bf7ebe commit bf8a4a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 data-toc-skip>[[${singlePage.spec.title}]]</h1>
group="content.halo.run"
kind="Post"
th:attr="name=${singlePage.metadata.name}"
colorScheme="document.documentElement.getAttribute('data-mode') === 'light' ? 'light' : 'dark'"
colorScheme="window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'"
/>
</div>
</th:block>
Expand Down
2 changes: 1 addition & 1 deletion templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
group="content.halo.run"
kind="Post"
th:attr="name=${post.metadata.name}"
colorScheme="document.documentElement.getAttribute('data-mode') === 'dark' ? 'dark' : 'light'"
colorScheme="window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'"
/>
</div>
<!-- .post-tail-bottom -->
Expand Down

0 comments on commit bf8a4a4

Please sign in to comment.