fix: prevent capability chip styles from leaking into dark theme - #9540
Closed
Sisyphbaous-DT-Project wants to merge 1 commit into
Closed
fix: prevent capability chip styles from leaking into dark theme#9540Sisyphbaous-DT-Project wants to merge 1 commit into
Sisyphbaous-DT-Project wants to merge 1 commit into
Conversation
修正 CapabilitySourceChip 深色样式的 scoped :global() 选择器范围,避免 Vue 编译后将标签颜色错误应用到整个 PurpleThemeDark 根节点。 保留五种能力来源标签的既有配色,仅将主题祖先与目标子类放入同一全局选择器。 验证:36 项 Dashboard Node 测试通过;pnpm 10.28.2 生产构建通过;构建产物确认 #80cbc4 仅作用于 mixed 标签。
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
Member
|
already fixed in #9541 |
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.
AstrBot v4.27.1 can render WebUI text and icons in teal after switching to dark mode. The dark-mode overrides in
CapabilitySourceChip.vueused:global()only around the theme ancestor. With the currently locked Vue 3.3.4 compiler, selectors such as:were emitted as a bare
.v-theme--PurpleThemeDarkselector. The last override therefore appliedcolor: #80cbc4 !importantto the entire dark theme container instead of only the mixed capability source chip.Modifications / 改动点
Wrap the complete dark-theme ancestor and capability chip descendant selector in
:global()for theplugin,mcp,local,preset, andmixedtones.Preserve all existing chip colors while preventing them from being inherited by unrelated WebUI content.
Keep the light theme, theme color definitions, public APIs, dependencies, and generated files unchanged.
This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
Manual verification on Windows:
Automated and build verification:
The generated
CapabilitySourceChip-*.csscontains all five descendant selectors, contains no bare.v-theme--PurpleThemeDark { color: ... }rule, and applies#80cbc4only to.capability-source-chip--mixed.Checklist / 检查清单