fix(button): primaryColor and dangerColor tokens not working with sol…#55934
Conversation
…id variant - Add text color override for primary solid variant - Add text color override for danger solid variant - Align implementation with default button pattern - Add demo test case for token customization
|
|
👁 Visual Regression Report for PR #55934 Failed ❌
Important There are 3 diffs found in this PR: 🔄
|
📝 WalkthroughSummary by CodeRabbit发布说明
✏️ Tip: You can customize this high-level summary in your review settings. Walkthrough为 Button 组件引入了主题示例文件并在样式层对变体(solid/outlined/dashed)添加显式文本色与悬停/激活态处理,以恢复并支持 primaryColor、dangerColor、defaultColor 等主题令牌的生效。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 分钟
诗
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @tuzixiangs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求解决了 Ant Design v6 中 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
这个 Pull Request 旨在修复 Ant Design v6 中 Button 组件 variant="solid" 状态下 primaryColor 和 dangerColor token 不生效的问题。您通过在 primary 和 danger 颜色变体的样式中为 solid 变体添加特定的 text-color 覆盖来解决此问题,使其能够正确应用 ConfigProvider 中配置的 primaryColor 和 dangerColor token。这个改动是正确的,并且与 default 按钮的实现方式保持了一致。此外,您还添加了一个新的演示页面 debug-color-variant.tsx 来验证修复效果,这是一个很好的实践。
我的评审意见主要集中在 components/button/style/variant.ts 文件中,我发现新添加的部分代码存在一些可以简化的地方,以提高代码的简洁性和可维护性。具体细节请查看我的评论。
More templates
commit: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/button/demo/debug-color-variant.tsx (1)
1-4: import 顺序可以稍微整理一下(可选)功能上完全没问题,但从项目约定看,demo 推荐的导入顺序是:React → 依赖 → antd 组件 → 自定义组件 → types → styles。这里
antd-style作为依赖,理论上可以放在 antd 之前,同时把ThemeConfig的类型导入与 antd 相关导入放到一起,会更统一一些。不过这只是风格层面的优化,不影响合并。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/button/demo/debug-color-variant.tsx(3 hunks)components/button/style/variant.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Always use TypeScript with strict type checking
Never useanytype - define precise types instead
Use interfaces (not type aliases) for object structures
Export all public interface types
Prefer union types over enums, useas constfor constants
Use early returns to improve readability
Support tree shaking
Follow import order: React → dependencies → antd components → custom components → types → styles
Prefer antd built-in components over external dependencies
Pass all ESLint and TypeScript checks
No console errors or warnings
**/*.{ts,tsx}: Use camelCase for property names
All components and functions must provide accurate type definitions
Avoid usinganytype, define types as precisely as possible
Use interface rather than type alias for defining object structures
All TypeScript should compile without errors or warnings
Use generics appropriately to enhance type flexibility
Use intersection types (&) to merge multiple types
Use literal union types to define limited option sets
Avoid using enum, prefer union types andas const
Rely on TypeScript's type inference as much as possible
Use type assertions (as) only when necessary
Complex data structures should be split into multiple interface definitions
Avoid outdated APIs and keep updated to new recommended usage
Files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
components/**/*.tsx
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
components/**/*.tsx: Component props interfaces should be namedComponentNameProps
Component ref types should useReact.ForwardRefRenderFunction
Use functional components with hooks exclusively (no class components)
Apply performance optimizations with React.memo, useMemo, useCallback appropriately
Support server-side rendering
Components must support ref forwarding with structure including nativeElement, focus, and other methods
Use PascalCase for component names
Use camelCase for props with specific patterns:default+PropNamefor defaults,forceRenderfor force rendering,openinstead ofvisiblefor panel state,show+PropNamefor display toggles,PropName+ablefor capabilities,dataSourcefor data source,disabledfor disabled state,extrafor additional content,iconfor icons,triggerfor triggers,classNamefor CSS classes
Useon+EventNamepattern for event handlers (e.g.,onClick,onChange)
Useon+SubComponentName+EventNamepattern for sub-component events
Use complete names, never abbreviations in prop naming
Optimize for minimal re-renders
UseuseLocalehook fromcomponents/locale/index.tsx
Support accessibility (WCAG 2.1 AA)
Files:
components/button/demo/debug-color-variant.tsx
components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Never hardcode colors, sizes, or spacing values
components/**/*.{ts,tsx}: Use TypeScript and React for component development
Use functional components and hooks, avoid class components
Use PascalCase for component names
Use complete names rather than abbreviations in component naming
Initialize properties should usedefault+PropNamenaming pattern
Panel opening should useopenprop instead ofvisible
Event handlers should followon+EventNamenaming pattern
Child component events should followon+SubComponentName+EventNamenaming pattern
Components should provide arefattribute withnativeElementandfocusmethods
Export all public interface types for user convenience
Component props should use interface definition namedComponentNameProps
Use CSS transitions for simple animations, rc-motion for complex animations
Respect user's prefers-reduced-motion setting for animations
Follow WCAG 2.1 AA level accessibility standards for styling
Achieve 100% test coverage
UseuseLocalehook fromcomponents/locale/index.tsxto get localization configuration
Use React.memo, useMemo, and useCallback appropriately for performance optimization
UseReact.ForwardRefRenderFunctionfor component ref types
Callback function types should have explicit parameter and return value definitions
Component state should have dedicated interfaces (e.g., ComponentNameState)
Components should display well on different screen sizes (responsive design)
Components should support right-to-left (RTL) reading direction
Support page zoom to 200% with normal layout
Avoid animations that cause flickering
Ensure code runs normally with no console errors
Avoid unnecessary re-renders
Support Tree Shaking for bundle optimization
Files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
components/*/demo/*.tsx
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
components/*/demo/*.tsx: Keep demo code concise and copy-pasteable
Focus each demo on a single feature
Use kebab-case for demo filenames:basic.tsx,custom-filter.tsx
Files:
components/button/demo/debug-color-variant.tsx
**/*.{ts,tsx,md}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use 2-space indentation
Files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
**/*.{ts,tsx,css}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Maintain cross-browser compatibility
Files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js}: Use early returns to improve code readability
Pass all ESLint and TypeScript checks
Files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
components/**/demo/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
components/**/demo/*.tsx: Demo code should be concise and suitable for users to copy directly into their projects
Each demo should focus on demonstrating one feature point
Demo files should be named with lowercase hyphen-separated words (e.g., basic.tsx, custom-filter.tsx)
Demo code import order: React → dependencies → antd components → custom components → types → styles
Demo code should use 2-space indentation, arrow functions, and camelCase naming
Arrange demos from simple to complex
Files:
components/button/demo/debug-color-variant.tsx
components/**/style/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
components/**/style/*.ts: Use@ant-design/cssinjsfor all styling
Generate styles with functions namedgen[ComponentName]Style
Use design tokens from the Ant Design token system
Support both light and dark themes
Use CSS logical properties for RTL support (e.g.,margin-inline-startinstead ofmargin-left)
Respectprefers-reduced-motionfor animations
Files:
components/button/style/variant.ts
components/**/style/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Component Token naming format should follow:
variant (optional)+semantic part+semantic part variant (optional)+css property+size/disabled (optional)
Files:
components/button/style/variant.ts
components/**/style/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
components/**/style/**/*.{ts,tsx}: Use@ant-design/cssinjsas the styling solution
Style generation functions should followgen[ComponentName]Stylenaming convention
Use CSS-in-JS with performance considerations, avoid unnecessary style recalculation
Use class selectors instead of tag selectors for style overrides to improve specificity
Use CSS logical properties (margin-inline-start) instead of directional properties (margin-left) for RTL support
Ensure sufficient color contrast and do not rely on color alone to convey information
Components should use global Tokens and component-level Tokens for styling
Avoid hardcoding colors, sizes, spacing values; use design Tokens instead
Component-level Token naming should follow: Component + property name (e.g., buttonPrimaryColor)
Token modifications should cascade downward to ensure design system consistency
All components must support dark mode
Provide clear visual indication for focus state
Files:
components/button/style/variant.ts
🧠 Learnings (25)
📓 Common learnings
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Component-level Token naming should follow: Component + property name (e.g., buttonPrimaryColor)
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Use design tokens from the Ant Design token system
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Avoid hardcoding colors, sizes, spacing values; use design Tokens instead
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/demo/*.tsx : Demo code import order: React → dependencies → antd components → custom components → types → styles
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Avoid hardcoding colors, sizes, spacing values; use design Tokens instead
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Ensure sufficient color contrast and do not rely on color alone to convey information
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Support both light and dark themes
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Component-level Token naming should follow: Component + property name (e.g., buttonPrimaryColor)
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Use design tokens from the Ant Design token system
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/*.{ts,tsx} : Never hardcode colors, sizes, or spacing values
Applied to files:
components/button/demo/debug-color-variant.tsxcomponents/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/demo/*.tsx : Arrange demos from simple to complex
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/*/demo/*.tsx : Focus each demo on a single feature
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/*/demo/*.tsx : Keep demo code concise and copy-pasteable
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Use `ant-design/cssinjs` as the styling solution
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to components/**/style/*.ts : Use `ant-design/cssinjs` for all styling
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T10:42:01.303Z
Learnt from: Wxh16144
Repo: ant-design/ant-design PR: 55810
File: .dumi/theme/common/VersionUpgrade/ChangeLog.tsx:69-71
Timestamp: 2025-11-24T10:42:01.303Z
Learning: In Ant Design's `.dumi/theme/` documentation and theme files, browser compatibility considerations are less strict than in the component library itself. Native APIs like ResizeObserver can be used directly without requiring polyfills or wrapper packages that are used in the main components.
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:30:28.374Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:30:28.374Z
Learning: Applies to **/*.{ts,tsx} : Prefer antd built-in components over external dependencies
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-13T02:52:08.942Z
Learnt from: meet-student
Repo: ant-design/ant-design PR: 55697
File: components/drawer/index.tsx:86-88
Timestamp: 2025-11-13T02:52:08.942Z
Learning: In Ant Design components (components/**/*.{ts,tsx}), always use `import useId from 'rc-util/lib/hooks/useId'` instead of `React.useId()` for generating unique IDs, to ensure compatibility with React 16-19. The rc-util hook automatically uses the native implementation in React 18+ and provides a fallback for older versions.
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Use CSS-in-JS with performance considerations, avoid unnecessary style recalculation
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : All components must support dark mode
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/*.{ts,tsx} : Use TypeScript and React for component development
Applied to files:
components/button/demo/debug-color-variant.tsx
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/*.{ts,tsx} : Component Token naming format should follow: `variant (optional)` + `semantic part` + `semantic part variant (optional)` + `css property` + `size/disabled (optional)`
Applied to files:
components/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Token modifications should cascade downward to ensure design system consistency
Applied to files:
components/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Use class selectors instead of tag selectors for style overrides to improve specificity
Applied to files:
components/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Provide clear visual indication for focus state
Applied to files:
components/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/*.{ts,tsx} : Follow WCAG 2.1 AA level accessibility standards for styling
Applied to files:
components/button/style/variant.ts
📚 Learning: 2025-11-24T16:31:15.831Z
Learnt from: CR
Repo: ant-design/ant-design PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:31:15.831Z
Learning: Applies to components/**/style/**/*.{ts,tsx} : Components should use global Tokens and component-level Tokens for styling
Applied to files:
components/button/style/variant.ts
🧬 Code graph analysis (1)
components/button/demo/debug-color-variant.tsx (1)
components/badge/demo/component-token.tsx (1)
ConfigProvider(6-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: size
- GitHub Check: build
- GitHub Check: test-react-latest (dom, 2/2)
- GitHub Check: test lib/es module (es, 2/2)
- GitHub Check: lint
- GitHub Check: test-react-legacy (18, 1/2)
- GitHub Check: test-node
- GitHub Check: test-react-latest (dom, 1/2)
- GitHub Check: test-react-legacy (18, 2/2)
- GitHub Check: test lib/es module (es, 1/2)
- GitHub Check: visual-diff snapshot (1/2)
- GitHub Check: visual-diff snapshot (2/2)
- GitHub Check: build
- GitHub Check: build preview
🔇 Additional comments (2)
components/button/demo/debug-color-variant.tsx (1)
50-57: ThemeConfig 使用合理,新示例很好覆盖修复场景
- 将
theme声明为ThemeConfig能保证在配置components.Button.primaryColor/dangerColor时有完整类型提示,符合 ConfigProvider 的推荐用法。- 新增的 “theme config” 区块同时覆盖:
type="primary" variant="solid"color="primary" variant="solid"color="danger" variant="solid"
这正好对应 issue 中 solid 变体不可通过组件级 token 自定义文字颜色的问题,便于本地回归和后续排查。- 配置值使用简单颜色字符串('pink' / 'green')在 debug/demo 场景是合理的,和 Badge 的 component token demo 方式保持一致。
这部分我没有发现需要修改的问题。
Also applies to: 101-114
components/button/style/variant.ts (1)
167-200: primary / danger 的 solid 文本颜色覆盖方式正确,符合 token 设计
- 在
&${componentCls}-color-primary/&${componentCls}-color-dangerous内增加&${componentCls}-variant-solid,将text-color分别绑定到token.primaryColor和token.dangerColor,并让 hover / active 都回落到同一 CSS 变量,这样 ConfigProvider 中的组件级 token 就能精确控制 solid 按钮文字颜色,而不再被全局的colorTextLightSolid覆盖。- 颜色块写在 Variants 块之后,选择器也更具体(
.ant-btn-color-xxx.ant-btn-variant-solid),因此在 CSS 级联中可以可靠地覆写通用 solid 变量。- 新代码完全使用 Button 相关 token,没有引入新的硬编码颜色,符合组件样式使用 token 而非魔法值的要求。Based on learnings.
整体来看,这段修改实现简洁、方向正确,我这边没有其他阻塞意见。
Bundle ReportChanges will increase total bundle size by 2.61kB (0.07%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|
…id variant - Add text color override for primary solid variant - Add text color override for danger solid variant - Align implementation with default button pattern - Add demo test case for token customization
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #55934 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 803 803
Lines 14831 14831
Branches 3916 3916
=========================================
Hits 14831 14831 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@tuzixiangs @meet-student What is left to do for this PR to be merged? |










English Template / 英文模板
🤔 这个变动的性质是?
🔗 相关 Issue
Closes #55931
Closes #55959
💡 需求背景和解决方案
问题描述
primaryColor和dangerColorToken 在solid变体下不生效。defaultHoverBg和defaultActiveBgToken 在outlined和dashed变体下不生效。解决方案
variant.ts中,为 Primary 和 Danger 颜色变体添加 Solid 样式覆盖,使其能够正确应用primaryColor和dangerColorToken。variant.ts中,为 Outlined 和 Dashed 变体添加背景色覆盖,使其能够正确应用defaultHoverBg和defaultActiveBgToken。📝 更新日志