feat(switch): support square and line shape variants - #2579
Closed
Actv6 wants to merge 1 commit into
Closed
Conversation
Add two new shape modifiers alongside the existing round appearance, addressing Tencent#2563: - .t-switch--shape-square: rounded-rectangle track and handle - .t-switch--shape-line: thin track rendered via ::before, with the circular handle floating on top Introduces @switch-shape-square-border-radius and @switch-line-track-height-{l,default,s} tokens for downstream theming.
Collaborator
|
谢谢参与犀牛鸟活动,讨论后这个issue 决定采纳 #2604 继续推进 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add two new shape modifiers alongside the existing round appearance,
addressing #2563:
.t-switch--shape-square: rounded-rectangle track and handle.t-switch--shape-line: thin track rendered via ::before, with thecircular handle floating on top
Introduces
@switch-shape-square-border-radiusand@switch-line-track-height-{l,default,s}tokens for downstream theming.🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
背景
Switch 组件当前仅提供圆形(round)外观,样式过于单一,不便于设计和开发。Issue #2563 希望补齐
square(圆角矩形)与line(线性)两种外观。方案
在
style/web/components/switch/下按 TDesign 一贯的--shape-xxx修饰符约定(参考 Button 组件)新增两个类,默认外观(不加 modifier)保持为 round