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(icon): custom icon prefix #117

Merged
merged 2 commits into from
Jan 20, 2022
Merged

feat(icon): custom icon prefix #117

merged 2 commits into from
Jan 20, 2022

Conversation

vhxubo
Copy link
Contributor

@vhxubo vhxubo commented Jan 15, 2022

#29

customPrefix

原理

  • 抽离 .t-icon-base, 并放在 classNames 末尾, 防止部分样式覆盖
  • 配置 Icon 组件的 prefix 后, classNames 中会配置 class="{{ prefix }} {{ prefix }}-{{ name }}" 替换掉 class="{{ classPrefix }} {{ classPrefix }}-{{ name }}", 上一步提取出来的 .t-icon-base 实现对组件原始样式的最小影响

实现

<t-icon prefix="icon" name="a-1h"></t-icon> => <t-icon class="t-class icon icon-a-1h t-icon-base"></t-icon>

希望有更好的解决方案...

@LeeJim
Copy link
Collaborator

LeeJim commented Jan 17, 2022

关联 issue 是需要关键词的,如 resolve #29

@LeeJim LeeJim linked an issue Jan 17, 2022 that may be closed by this pull request
@LeeJim LeeJim requested a review from jin0209 January 17, 2022 12:25
@vhxubo
Copy link
Contributor Author

vhxubo commented Jan 17, 2022

关联 issue 是需要关键词的,如 resolve #29

好的:partying_face:

Copy link
Collaborator

@jin0209 jin0209 left a comment

Choose a reason for hiding this comment

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

tgtm

@jin0209 jin0209 merged commit bdcafa4 into Tencent:develop Jan 20, 2022
@vhxubo vhxubo deleted the feat/icon/prefix branch January 20, 2022 12:46
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.

icon组件添加自定义prefix
3 participants