feat: added dark mode toggle and mobile collapsible menu.#6
Open
ayyyyano wants to merge 2 commits into
Open
Conversation
XFJ-YYQF
requested changes
Jul 21, 2026
XFJ-YYQF
left a comment
Contributor
There was a problem hiding this comment.
好棒好棒,窝仔细看了喵,都是些很简单的无伤大雅的小问题喵
| isDark.value = !isDark.value | ||
| } | ||
|
|
||
| // If no cookie set yet, use system preference on client |
Contributor
There was a problem hiding this comment.
先通过CSS读浏览器深色偏好,优先跟随浏览器偏好,手动设置了再往cookie写
| @apply bg-gray-50 text-gray-900 min-h-screen; | ||
| } | ||
|
|
||
| html.dark body { |
Contributor
There was a problem hiding this comment.
只改了背景,没有改控件,会出现比如侧边滚动条还是亮色的情况
Suggested change
| html.dark body { | |
| html.dark { color-scheme: dark; } |
|
|
||
| function hideHistoryDelayed() { | ||
| hideHistoryTimer = setTimeout(() => { showHistory.value = false }, 200) | ||
| } |
Contributor
There was a problem hiding this comment.
卸载时 clearTimeout;数据应该设置只保留字符串。
| // On server: set html class from cookie before rendering | ||
| useHead({ | ||
| htmlAttrs: computed(() => ({ | ||
| class: darkMode.value === 'dark' ? 'dark' : '', |
Contributor
|
哦对了,移动端展开菜单收纳是不是还是横向排布比较好,这样感觉有点太占空间了(? |
Author
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


描述
变更内容
补充信息
可能存在的移动端问题
修复示例