feat(components): [button] add dashed prop#22738
Conversation
commit: |
|
🧪 Playground Preview: https://element-plus.run/?pr=22738 |
|
@lxKylin This PR has conflicts, please resolve them. |
📝 WalkthroughWalkthroughAdded a new "dashed" styling variant for Button: prop and ConfigProvider support, composable exposure, component class binding, SCSS mixins and theme styles, docs/examples updates, and tests verifying dashed behavior and precedence. Changes
Sequence Diagram(s)sequenceDiagram
participant App as App / Example
participant Config as ConfigProvider
participant Button as ElButton
participant Use as useButton
participant Theme as Theme (SCSS)
App->>Config: provide button config (dashed?: boolean)
App->>Button: render <el-button :dashed="..."> (may pass prop)
Button->>Use: resolve dashed (prop ?? Config.dashed ?? false)
Use-->>Button: return _dashed
Button->>Theme: render with class .is-dashed when _dashed true
Theme-->>Button: apply dashed styles (border-style: dashed, hover/active vars)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@docs/en-US/component/config-provider.md`:
- Around line 112-119: Update the button config object signature
`{autoInsertSpace?: boolean, type?: string, plain?: boolean, round?: boolean}`
to include `text?: boolean` and `dashed?: boolean` (with version markers
^(2.11.0) and ^(2.13.3) respectively) so the signature matches the Button
Attribute table; ensure the updated signature reads `{autoInsertSpace?: boolean,
type?: string, plain?: boolean, round?: boolean, text?: boolean ^(2.11.0),
dashed?: boolean ^(2.13.3)}` and keep formatting consistent with the surrounding
docs.
In `@packages/theme-chalk/src/mixins/_button.scss`:
- Around line 63-132: The dashed button mixin button-dashed currently gives type
variants a filled look because each variant's 'bg-color' is set to a light-9
token; change those bg-color entries (inside the $button-color-types map for '',
'hover', and 'active') to use a transparent/blank token instead of 'light-9' so
dashed variants remain border-only, and ensure the disabled block (is-disabled)
still uses the intended getCssVar fallbacks only where a real background is
required; update the map entries referenced by `@each` ($button-color-types) and
the keys 'bg-color' so the included css-var-from-global and subsequent getCssVar
calls pick up the transparent value for dashed types.
dashed prop
|
@lxKylin Thanks for your contribution! ❤️ |




Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.Summary by CodeRabbit
New Features
Documentation
Examples
Tests
Style
✏️ Tip: You can customize this high-level summary in your review settings.