Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛[BUG] Code component backgroundColor not changing in darkTheme #6629

Closed
alexchen8 opened this issue Feb 17, 2023 · 1 comment
Closed
Labels
AI Reply ⭕️ bug Something isn't working form

Comments

@alexchen8
Copy link

🐛 bug 描述

Code component background color not changing in dark theme

📷 复现步骤

<ProDescriptions.Item
  label="Code"
  valueType="jsonCode"
>
  {'{"key": "value"}'}
</ProDescriptions.Item>

🏞 期望结果

backgroundColor based on theme

© 版本信息

  • ProComponents 版本: 2.3.52

🚑 其他信息

Color is hard coded here

@chenshuai2144 chenshuai2144 added ⭕️ bug Something isn't working form labels Feb 19, 2023
@chenshuai2144
Copy link
Contributor

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns.
此回复基于 ChatGPT 自动生成,可以尝试下方案,官方员会在一定时间后继续继续处理。

您好,感谢反馈!根据您提供的信息,我已经确认了这是一个 bug,并且在 ProComponents 的 GitHub 仓库中创建了一个 issue

目前,您可以使用以下代码,手动将 Code 组件的颜色更改为适合您所需主题的颜色:

<ProDescriptions.Item
  label="Code"
  valueType="jsonCode"
>
  <Code style={{ backgroundColor: darkTheme ? '#3B3B3B' : '#fff' }}>{'{"key": "value"}'}</Code>
</ProDescriptions.Item>

其中,darkTheme 可以替换为您所使用的主题的布尔类型。如果是自己定义的主题颜色,可以参考 ProTable 自定义主题 中自定义主题的方式来获取主题颜色。

我们会尽快修复该 bug,并在未来的版本中发布。 如果您有任何其他问题或疑问,请随时让我们知道。感谢您使用 ProComponents!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Reply ⭕️ bug Something isn't working form
Projects
None yet
Development

No branches or pull requests

2 participants