Skip to content

Commit

Permalink
fix: fix activity-indicator color in button (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Jun 28, 2021
1 parent 0c86d81 commit 2a4c8c8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports[`Button icon 1`] = `
exports[`Button loading 1`] = `
<button
aria-disabled="false"
class="za-button za-button--default za-button--md za-button--radius"
class="za-button za-button--default za-button--md za-button--radius za-button--loading"
type="button"
>
<div
Expand Down
1 change: 1 addition & 0 deletions packages/zarm/src/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class Button extends PureComponent<ButtonProps, {}> {
[`${prefixCls}--ghost`]: !!ghost,
[`${prefixCls}--shadow`]: !!shadow,
[`${prefixCls}--disabled`]: !!disabled,
[`${prefixCls}--loading`]: loading,
});

const iconRender = loading ? <ActivityIndicator /> : icon;
Expand Down
8 changes: 8 additions & 0 deletions packages/zarm/src/button/style/component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
var(--button-primary-shadow-color),
);

@include m(loading) {
@include button-loading(var(--button-primary-color));
}

@include m(link) {
@include button-link(
var(--button-primary-ghost-color),
Expand Down Expand Up @@ -130,6 +134,10 @@
var(--button-danger-shadow-color),
);

@include m(loading) {
@include button-loading(var(--button-danger-color));
}

@include m(link) {
@include button-link(
var(--button-danger-ghost-color),
Expand Down
11 changes: 11 additions & 0 deletions packages/zarm/src/button/style/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,14 @@
border-style: solid;
border-radius: $border-radius;
}

// 加载状态图标颜色设置
@mixin button-loading($color) {
@include b(activity-indicator) {
@include m(circular) {
circle {
stroke: $color;
}
}
}
}

0 comments on commit 2a4c8c8

Please sign in to comment.