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

feat(Tag): 增加自定义颜色参数 #3101

Merged
merged 10 commits into from
Mar 14, 2024
Merged

Conversation

maoyiluo
Copy link
Collaborator

@maoyiluo maoyiluo commented Mar 5, 2024

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

#3004

💡 需求背景和解决方案

增加color参数。当color参数被传入时,根据不同的variant进行标签颜色的修改

dark:

  1. 背景颜色会被设置为this.color
  2. 字体颜色根据this.color的亮度进行计算,如果亮度 > 0.5使用黑色,反之使用白

light

  1. 字体颜色会被设置为this.color
  2. 背景会通过tvision-color计算色阶,使用颜色最浅的色阶

light-outline

  1. 字体颜色会被设置为this.color
  2. 背景会通过tvision-color计算色阶,使用颜色最浅的色阶
  3. border颜色会被设置为this.color

outline

  1. 字体颜色会被设置为this.color
  2. border颜色会被设置为this.color

效果:
效果图

📝 更新日志

  • feat(tag): Tag组件新增colorAPI,支持自定义颜色

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Copy link
Contributor

github-actions bot commented Mar 6, 2024

完成

@uyarn uyarn changed the title tag组件增加自定义颜色参数 feat(Tag): 增加自定义颜色参数 Mar 6, 2024
@uyarn uyarn added the WIP work in progress label Mar 10, 2024
@uyarn uyarn removed the WIP work in progress label Mar 14, 2024
Copy link
Collaborator

@uyarn uyarn left a comment

Choose a reason for hiding this comment

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

LGTM

@uyarn uyarn merged commit f91217b into Tencent:develop Mar 14, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Apr 11, 2024
16 tasks
uyarn added a commit that referenced this pull request Apr 11, 2024
* feat(tag): add color attribute to t-tag in order to customize tag color

feat #3004

* feat: tag自定义颜色下light和light-outline的背景色使用计算的色阶展示

feat #3004

* feat: 补充缺失的类型

* refactor(tag): 将获取颜色样式的代码抽取成方法

* feat(tag): 改用chorma计算色阶

* chore: update snapshot

* chore: update demo display

* feat(tag): use transparent color for the light mode t-tag when using with color props

* chore: update snapshot

* feat: 补充类型声明 & 清理多余依赖

---------

Co-authored-by: Uyarn <uyarnchen@gmail.com>
uyarn added a commit that referenced this pull request Apr 11, 2024
* chore: update group code (#3111)

* feat(Tag): 增加自定义颜色参数 (#3101)

* feat(tag): add color attribute to t-tag in order to customize tag color

feat #3004

* feat: tag自定义颜色下light和light-outline的背景色使用计算的色阶展示

feat #3004

* feat: 补充缺失的类型

* refactor(tag): 将获取颜色样式的代码抽取成方法

* feat(tag): 改用chorma计算色阶

* chore: update snapshot

* chore: update demo display

* feat(tag): use transparent color for the light mode t-tag when using with color props

* chore: update snapshot

* feat: 补充类型声明 & 清理多余依赖

---------

Co-authored-by: Uyarn <uyarnchen@gmail.com>

* fix(transfer): trigger exception for the search event (#3118)

* chore: fix image locale and update snapshot (#3119)

* fix(loading): export directive alias (#3120)

Co-authored-by: yojim <chenyujian@oigcn.cn>

* feat(TagInput): expand the deletion function of collapsedItems(#2941) (#2942)

* feat(TagInput): expand the deletion function of collapsedItems(#2941)

* fix(TagInput): onClose parameter(#2941)

* chore: update api

* chore: update api

* chore: update api

* chore: update api

---------

Co-authored-by: Uyarn <uyarnchen@gmail.com>

* fix(checkbox): checkboxGroup max effects disable status

* docs(dialog): add comment for usage precautions (#3126)

* fix(date-picker): over parse when valueType is Date (#3127)

* fix(date-picker): over parse when valueType is Date

* chore: fix lint

* docs(dialog): mention destroy DOM elements in dialog.md (#3125)

* docs(dialog): mention destroy DOM elements in dialog.md

* docs(dialog): add more specific description in dialog.md

* docs(dialog): update translations in dialog.en-US.md

* docs(dialog): update colons in dialog.en-US.md

* fix(menu): remove usage of `height` in menu demos (#3135)

* fix(menu): remove usage of `height` in menu demos

* fix(menu): update snapshots

* fix(table): use the `fixedRows` property console to report errors (#3134)

* fix(Transfer): fix tree data filter error (#3137)

* fix(Transfer): fix tree data filter error

* fix(Transfer): fix tree data filter error

* fix(datepicker): fix datepicker week parse error (#3138)

* chore: rename loading directive export (#3140)

* chore: release 1.9.2 (#3139)

* chore: release 1.9.2

* chore: update snapshot

---------

Co-authored-by: maoyiluo <43943796+maoyiluo@users.noreply.github.com>
Co-authored-by: betavs <34408516+betavs@users.noreply.github.com>
Co-authored-by: Yoki <yujian0108@gmail.com>
Co-authored-by: yojim <chenyujian@oigcn.cn>
Co-authored-by: odinlin <topazur@163.com>
Co-authored-by: LoopZhou <13745660+LoopZhou@users.noreply.github.com>
Co-authored-by: Lyan-u <46185702+Lyan-u@users.noreply.github.com>
Co-authored-by: Yunfei Shen <shenyf0608@163.com>
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