Skip to content

Commit

Permalink
feat(Button): update disabled configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna committed Aug 11, 2020
1 parent 4a9a79e commit 18140ab
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 19 deletions.
84 changes: 65 additions & 19 deletions src/button/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,38 @@
&[disabled] {
cursor: not-allowed;

@include button-color(
$btn-pure-color-disabled,
$btn-pure-color-disabled,
$btn-pure-bg-disabled,
$btn-pure-bg-disabled,
$btn-pure-border-color-disabled,
$btn-pure-border-color-disabled
);
&#{$btn-prefix}-normal {
@include button-color(
$btn-pure-normal-color-disabled,
$btn-pure-normal-color-disabled,
$btn-pure-normal-bg-disabled,
$btn-pure-normal-bg-disabled,
$btn-pure-normal-border-color-disabled,
$btn-pure-normal-border-color-disabled
);
}

&#{$btn-prefix}-primary {
@include button-color(
$btn-pure-primary-color-disabled,
$btn-pure-primary-color-disabled,
$btn-pure-primary-bg-disabled,
$btn-pure-primary-bg-disabled,
$btn-pure-primary-border-color-disabled,
$btn-pure-primary-border-color-disabled
);
}

&#{$btn-prefix}-secondary {
@include button-color(
$btn-pure-secondary-color-disabled,
$btn-pure-secondary-color-disabled,
$btn-pure-secondary-bg-disabled,
$btn-pure-secondary-bg-disabled,
$btn-pure-secondary-border-color-disabled,
$btn-pure-secondary-border-color-disabled
);
}
}

/* 警告按钮 */
Expand Down Expand Up @@ -226,6 +250,17 @@
transparent,
transparent
);
&.disabled,
&[disabled] {
@include button-color(
$btn-text-disabled-color,
$btn-text-disabled-color,
transparent,
transparent,
transparent,
transparent
);
}
}
&#{$btn-prefix}-secondary {
@include button-color(
Expand All @@ -236,6 +271,17 @@
transparent,
transparent
);
&.disabled,
&[disabled] {
@include button-color(
$btn-text-disabled-color,
$btn-text-disabled-color,
transparent,
transparent,
transparent,
transparent
);
}
}
&#{$btn-prefix}-normal {
@include button-color(
Expand All @@ -246,6 +292,17 @@
transparent,
transparent
);
&.disabled,
&[disabled] {
@include button-color(
$btn-text-disabled-color,
$btn-text-disabled-color,
transparent,
transparent,
transparent,
transparent
);
}
}
&.#{$css-prefix}large {
@include next-button-size(
Expand Down Expand Up @@ -283,17 +340,6 @@
$btn-size-s-icon-split-size
);
}
&.disabled,
&[disabled] {
@include button-color(
$btn-text-disabled-color,
$btn-text-disabled-color,
transparent,
transparent,
transparent,
transparent
);
}
&#{$btn-prefix}-loading {
@include button-color(
$btn-text-loading-color,
Expand Down
27 changes: 27 additions & 0 deletions src/button/scss/variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ $btn-pure-bg-disabled: $color-fill1-1 !default;
/// @namespace statement/disabled
$btn-pure-border-color-disabled: $color-line1-1 !default;

/// text
/// @namespace statement/disabled
$btn-pure-normal-color-disabled: $color-text1-1 !default;
/// background
/// @namespace statement/disabled
$btn-pure-normal-bg-disabled: $color-fill1-1 !default;
/// border color
/// @namespace statement/disabled
$btn-pure-normal-border-color-disabled: $color-line1-1 !default;
/// text
/// @namespace statement/normal
$btn-pure-normal-color: $color-text1-4 !default;
Expand All @@ -166,6 +175,15 @@ $btn-pure-normal-border-style: $line-solid !default;
// Secondary
// ----------------------------------------
/// text
/// @namespace statement/disabled
$btn-pure-secondary-color-disabled: $color-text1-1 !default;
/// background
/// @namespace statement/disabled
$btn-pure-secondary-bg-disabled: $color-fill1-1 !default;
/// border color
/// @namespace statement/disabled
$btn-pure-secondary-border-color-disabled: $color-line1-1 !default;
/// text
/// @namespace statement/normal
$btn-pure-secondary-color: $color-brand1-6 !default;
/// text
Expand All @@ -190,6 +208,15 @@ $btn-pure-secondary-border-style: $line-solid !default;
// Primary
// ----------------------------------------
/// text
/// @namespace statement/disabled
$btn-pure-primary-color-disabled: $color-text1-1 !default;
/// background
/// @namespace statement/disabled
$btn-pure-primary-bg-disabled: $color-fill1-1 !default;
/// border color
/// @namespace statement/disabled
$btn-pure-primary-border-color-disabled: $color-line1-1 !default;
/// text
/// @namespace statement/normal
$btn-pure-primary-color: $color-white !default;
/// text
Expand Down

0 comments on commit 18140ab

Please sign in to comment.