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: migrate less to token for Slider #42428
Conversation
42b5f08
to
ff3520a
Compare
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## feature #42428 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 649 649
Lines 10936 10944 +8
Branches 2965 2967 +2
=========================================
+ Hits 10936 10944 +8 ☔ View full report in Codecov by Sentry. |
<!-- prettier-ignore --> | ||
| Less 变量 | Component Token | 备注 | | ||
| --- | --- | --- | | ||
| `@slider-margin` | `iconFontSize` | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `@slider-margin` | `iconFontSize` | - | | |
| `@slider-margin` | - | 可由 `className` 或 `style` 直接修改 | |
| `@slider-rail-background-color` | `railBackgroundColor` | - | | ||
| `@slider-rail-background-color-hover` | `railBackgroundColorHover` | - | | ||
| `@slider-track-background-color` | `trackBackgroundColor` | - | | ||
| `@slider-track-background-color-hover` | `trackBackgroundColorHover` | - | | ||
| `@slider-handle-border-width` | `handleBorderWidth` | - | | ||
| `@slider-handle-background-color` | `handleBackgroundColor` | - | | ||
| `@slider-handle-color` | `handleColor` | - | | ||
| `@slider-handle-color-hover` | `handleColorHover` | - | | ||
| `@slider-handle-color-focus` | `handleColorFocus` | - | | ||
| `@slider-handle-color-focus-shadow` | `handleColorFocusShadow` | - | | ||
| `@slider-handle-color-tooltip-open` | `handleColorTooltipOpen` | - | | ||
| `@slider-handle-size` | `handleSize` | - | | ||
| `@slider-handle-margin-top` | `handleMarginTop` | - | | ||
| `@slider-handle-margin-left` | `handleMarginLeft` | - | | ||
| `@slider-handle-shadow` | `handleShadow` | - | | ||
| `@slider-dot-border-color` | `dotBorderColor` | - | | ||
| `@slider-dot-border-color-active` | `dotBorderColorActive` | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `@slider-rail-background-color` | `railBackgroundColor` | - | | |
| `@slider-rail-background-color-hover` | `railBackgroundColorHover` | - | | |
| `@slider-track-background-color` | `trackBackgroundColor` | - | | |
| `@slider-track-background-color-hover` | `trackBackgroundColorHover` | - | | |
| `@slider-handle-border-width` | `handleBorderWidth` | - | | |
| `@slider-handle-background-color` | `handleBackgroundColor` | - | | |
| `@slider-handle-color` | `handleColor` | - | | |
| `@slider-handle-color-hover` | `handleColorHover` | - | | |
| `@slider-handle-color-focus` | `handleColorFocus` | - | | |
| `@slider-handle-color-focus-shadow` | `handleColorFocusShadow` | - | | |
| `@slider-handle-color-tooltip-open` | `handleColorTooltipOpen` | - | | |
| `@slider-handle-size` | `handleSize` | - | | |
| `@slider-handle-margin-top` | `handleMarginTop` | - | | |
| `@slider-handle-margin-left` | `handleMarginLeft` | - | | |
| `@slider-handle-shadow` | `handleShadow` | - | | |
| `@slider-dot-border-color` | `dotBorderColor` | - | | |
| `@slider-dot-border-color-active` | `dotBorderColorActive` | - | | |
| `@slider-rail-background-color` | `railBg` | - | | |
| `@slider-rail-background-color-hover` | `railHoverBg` | - | | |
| `@slider-track-background-color` | `trackBg` | - | | |
| `@slider-track-background-color-hover` | `trackHoverBg` | - | | |
| `@slider-handle-border-width` | `handleLineWidth` | - | | |
| `@slider-handle-background-color` | `handleBg` | - | | |
| `@slider-handle-color` | `handleColor` | - | | |
| `@slider-handle-color-hover` | `handleHoverColor` | - | | |
| `@slider-handle-color-focus` | `handleActiveColor` | - | | |
| `@slider-handle-color-focus-shadow` | - | 样式变化已废弃 | | |
| `@slider-handle-color-tooltip-open` | `handleActiveColor` | - | | |
| `@slider-handle-size` | `handleSize` | - | | |
| `@slider-handle-margin-top` | `handleMarginTop` | - | | |
| `@slider-handle-margin-left` | `handleMarginLeft` | - | | |
| `@slider-handle-shadow` | - | 样式变化已废弃 | | |
| `@slider-dot-border-color` | `dotBorderColor` | - | | |
| `@slider-dot-border-color-active` | `dotActiveBorderColor` | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleBg,handleColorHover,handleActiveColor 没有使用了
| `@slider-handle-shadow` | `handleShadow` | - | | ||
| `@slider-dot-border-color` | `dotBorderColor` | - | | ||
| `@slider-dot-border-color-active` | `dotBorderColorActive` | - | | ||
| `@slider-disabled-color` | `disabledColor` | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `@slider-disabled-color` | `disabledColor` | - | | |
| `@slider-disabled-color` | `trackBgDisabled` | - | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8fcd56f
to
880c734
Compare
components/slider/style/index.tsx
Outdated
trackHoverBg: string; | ||
handleColor: string; | ||
handleHoverColor: string; | ||
handleColorTooltipOpen: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该改成 handleActiveColor 了
components/slider/style/index.tsx
Outdated
dotBorderColor: '#303030', | ||
dotActiveBorderColor: 'tint(@primary-color, 50%)', // FIX ME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个颜色看下,应该用 token 的。
components/slider/style/index.tsx
Outdated
handleColor: token.colorPrimaryBorder, | ||
handleHoverColor: token.colorPrimaryHover, | ||
handleActiveColor: token.colorPrimary, | ||
dotBorderColor: '#303030', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个没用过
components/slider/style/index.tsx
Outdated
@@ -177,7 +187,7 @@ const genBaseStyle: GenerateStyle<SliderToken> = (token) => { | |||
position: 'absolute', | |||
width: dotSize, | |||
height: dotSize, | |||
backgroundColor: token.colorBgElevated, | |||
backgroundColor: token.dotBorderColor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用错地方了,是 borderColor 才对
components/slider/style/index.tsx
Outdated
boxShadow: 'none', | ||
cursor: 'not-allowed', | ||
}, | ||
|
||
[`${componentCls}-handle::after`]: { | ||
backgroundColor: token.colorBgElevated, | ||
backgroundColor: token.handleActiveColor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个也是,应该是蓝色圈的颜色
| `@slider-handle-background-color` | - | Deprecated | | ||
| `@slider-handle-color` | `handleColor` | - | | ||
| `@slider-handle-color-hover` | `handleActiveColor` | - | | ||
| `@slider-handle-color-focus` | - | Deprecated | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个也可以用 handleActiveColor
* ✨ feat: migrate less to token for Slider * ✨ feat: update snap * ✨ feat: update style * ✨ feat: update style * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: update * ✨ feat: update snap * ✨ feat: update * ✨ feat: update * ✨ feat: 删除未使用token * ✨ feat: update doc * ✨ feat: update dome * ✨ feat: update * ✨ feat: test ci * 📝 doc: update doc * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: add demo * ✨ feat: add demo * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * Apply suggestions from code review --------- Co-authored-by: MadCcc <1075746765@qq.com>
* refactor: refactor closeIcon * docs: update docs * refactor(Drawer): refactor drawer closeIcon (#42993) * feat: optimize closeIcon * refactor: refactor closeIcon * docs: update docs * feat: optimize code * feat: update test case * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * docs: update docs * ✨ feat: migrate less to token for Slider (#42428) * ✨ feat: migrate less to token for Slider * ✨ feat: update snap * ✨ feat: update style * ✨ feat: update style * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: test ci * ✨ feat: update * ✨ feat: update snap * ✨ feat: update * ✨ feat: update * ✨ feat: 删除未使用token * ✨ feat: update doc * ✨ feat: update dome * ✨ feat: update * ✨ feat: test ci * 📝 doc: update doc * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: update * ✨ feat: add demo * ✨ feat: add demo * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * ✨ feat: update for reviewer * Apply suggestions from code review --------- Co-authored-by: MadCcc <1075746765@qq.com> * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * feat: optimize code * docs: update docs --------- Co-authored-by: 黑雨 <wangning4567@163.com> Co-authored-by: MadCcc <1075746765@qq.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at 85e13ab
This pull request adds component token support for the slider component, which enables users to customize its style through the
ConfigProvider
component. It also adds a component token demo and documentation for the slider component in both Chinese and English languages. It updates the migrate less variables documentation to include the slider component.🔍 Walkthrough
🤖 Generated by Copilot at 85e13ab