Skip to content

feat: 添加使用系统强调色作为主题颜色的样式插件#4

Merged
GrassBlock1 merged 4 commits into
masterfrom
copilot/add-style-plugin-accent-color
May 1, 2026
Merged

feat: 添加使用系统强调色作为主题颜色的样式插件#4
GrassBlock1 merged 4 commits into
masterfrom
copilot/add-style-plugin-accent-color

Conversation

Copy link
Copy Markdown

Copilot AI commented May 1, 2026

  • Understand repo structure and plugin system
  • Create source file registry/lib/plugins/style/accent-color/index.ts
  • Create dist file registry/dist/plugins/style/accent-color.js
  • Handle rgba() color format in addition to rgb()
  • Add CSS.supports('color', 'AccentColor') guard to prevent fallback color being applied on unsupported browsers
  • Fix ESLint errors: use destructuring for getComputedStyle(el).color and add curly braces to if (!match)

Copilot AI and others added 2 commits May 1, 2026 09:05
Agent-Logs-Url: https://github.com/BlockG-ws/b23-evolved/sessions/447a4476-450c-4048-997b-4ca7499837c3

Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BlockG-ws/b23-evolved/sessions/447a4476-450c-4048-997b-4ca7499837c3

Co-authored-by: GrassBlock1 <46253950+GrassBlock1@users.noreply.github.com>
@GrassBlock1 GrassBlock1 marked this pull request as ready for review May 1, 2026 09:15
Copilot AI review requested due to automatic review settings May 1, 2026 09:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

新增一个样式插件,用系统 CSS 颜色关键字 AccentColor 读取操作系统强调色,并将其同步为 bilibili-evolved 的主题色,以便界面风格与系统主题保持一致。

Changes:

  • 新增 style.accentColor 插件:运行时读取系统强调色并写入 themeColor
  • 增加对应的预构建 UMD bundle 产物,供 registry 分发使用

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
registry/lib/plugins/style/accent-color/index.ts 插件源码:读取 AccentColor 并设置通用设置的 themeColor
registry/dist/plugins/style/accent-color.js 预构建的 UMD bundle(registry 分发产物)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread registry/lib/plugins/style/accent-color/index.ts Outdated
Copilot AI requested a review from GrassBlock1 May 1, 2026 09:26
@GrassBlock1
Copy link
Copy Markdown

@copilot fix ESLint errors

Copy link
Copy Markdown
Author

Copilot AI commented May 1, 2026

@copilot fix ESLint errors

Fixed in f48ed12. Two ESLint errors corrected in index.ts:

  • prefer-destructuring: getComputedStyle(el).colorconst { color } = getComputedStyle(el)
  • curly: added braces to if (!match) { return null }

Copilot AI requested a review from GrassBlock1 May 1, 2026 09:32
@GrassBlock1 GrassBlock1 merged commit 4d2b30a into master May 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants