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

fix(Radio): 修改Radio组件圆圈外层选中和禁用样式,个别动画参数用变量代替 #333

Merged
merged 1 commit into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/devui-vue/devui/radio/src/radio.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../../style/theme/color';
@import '../../style/core/_font';
@import '../../style/theme/animation';

.devui-radio {
display: flex;
Expand Down Expand Up @@ -30,10 +31,25 @@
}

&.active {
.devui-radio-material-outer {
opacity: 1;
stroke: $devui-form-control-line-active-hover;
transition: stroke 50ms $devui-animation-ease-in-out;

&.disabled {
stroke: $devui-icon-fill-active-disabled;
fill: transparent;
}
}

.devui-radio-material-inner {
opacity: 1;
transform: scale(1);
transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
transition: transform $devui-animation-duration-base $devui-animation-ease-in-out, opacity $devui-animation-duration-base $devui-animation-ease-in-out;

&.disabled {
fill: $devui-icon-fill-active-disabled;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/devui-vue/devui/radio/src/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export default defineComponent({
/>
<span class='devui-radio-material'>
<svg height='100%' width='100%' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'>
<circle class='devui-radio-material-outer' cx='512' cy='512' r='486.5' stroke-width='51' />
<circle class='devui-radio-material-inner' cx='512' fill-rule='nonzero' cy='512' r='320' />
<circle class={{ 'devui-radio-material-outer': true, disabled: disabled }} cx='512' cy='512' r='486.5' stroke-width='51' />
<circle class={{ 'devui-radio-material-inner': true, disabled: disabled }} cx='512' fill-rule='nonzero' cy='512' r='320' />
</svg>
</span>
<span class='devui-radio-label'>{$slots.default?.()}</span>
Expand Down
1 change: 0 additions & 1 deletion packages/devui-vue/devui/style/theme/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ $devui-disabled-line: var(--devui-disabled-line, #dfe1e6); // disabled边框颜
$devui-disabled-text: var(--devui-disabled-text, #adb0b8); // disabled文字颜色
$devui-primary-disabled: var(--devui-primary-disabled, #beccfa); //主要按钮disabled状态文字颜色
$devui-icon-fill-active-disabled: var(--devui-icon-fill-active-disabled, #beccfa); // svg图标激活状态禁用色
$devui-icon-fill-active-disabled: var(--devui-icon-fill-active-disabled, #beccfa); // svg图标激活状态禁用色
// 特殊背景色
$devui-label-bg: var(--devui-label-bg, #eef0f5); // 默认标签化选项背景色
$devui-connected-overlay-bg: var(--devui-connected-overlay-bg, #ffffff); // 有连接点的弹出菜单层背景色
Expand Down