Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Updates the T8Example.vue component to ensure non-dark theme examples have an explicit white background color for better visual consistency and readability.

Changes Made

  • Theme Detection: Added a computed property isDarkTheme that checks if an example should use dark theme based on:
    • mode prop being 'dark'
    • containerClass prop containing 'dark'
  • Conditional Styling: Applied a light CSS class to render containers when !isDarkTheme is true
  • Light Background: Added .render-container.light CSS rule with background-color: #ffffff

The dark theme examples continue to use the existing dark background (#1a1a1a), while light theme examples now have an explicit white background instead of relying on the default var(--vp-c-bg).

Testing

  • ✅ Site builds successfully without errors
  • ✅ Verified both English and Chinese examples pages render correctly
  • ✅ Confirmed light theme examples display white background (#ffffff)
  • ✅ Confirmed dark theme examples maintain dark background (#1a1a1a)
  • ✅ Code review completed with no issues
  • ✅ CodeQL security check passed with no vulnerabilities

Screenshots

Light theme examples with white background:
Light background

Dark theme example maintaining dark background:
Dark theme

Chinese examples page:
Chinese page

The changes are minimal and surgical, affecting only the background color logic without altering the core T8 rendering functionality.

Original prompt

Update the examples page on the official site of the antvis/T8 repository. Specifically, ensure that if the examples are not in dark theme, the background color of the container div is set to a light color. Adjust the necessary code logic to determine if the theme is dark, and add the required styling to implement a light background color accordingly.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 9, 2026 16:13
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
Copilot AI changed the title [WIP] Update examples page for light theme background Add explicit light background to examples containers Feb 9, 2026
@hustcc hustcc marked this pull request as ready for review February 9, 2026 16:21
@hustcc
Copy link
Member

hustcc commented Feb 9, 2026

@copilot 继续

Copy link
Contributor Author

Copilot AI commented Feb 9, 2026

@copilot 继续

已完成所有任务!✅

实现的功能:

  • 为非暗色主题的示例容器添加了明确的白色背景 (#ffffff)
  • 通过检测 modecontainerClass 属性来判断是否为暗色主题
  • 英文和中文示例页面均已验证正常工作

测试结果:

  • ✅ 网站构建成功
  • ✅ 浅色主题示例显示白色背景
  • ✅ 暗色主题示例保持深色背景 (#1a1a1a)
  • ✅ 代码审查无问题
  • ✅ 安全检查无漏洞

截图:

Copilot AI requested a review from hustcc February 9, 2026 22:53
@hustcc hustcc merged commit ff68c02 into main Feb 9, 2026
1 check passed
@hustcc hustcc deleted the copilot/update-examples-page-theme-again branch February 9, 2026 23:07
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.

2 participants