Skip to content

Commit

Permalink
fix(button): fix status style repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
2113ic committed Mar 22, 2024
1 parent 9ad8b2e commit f70340e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/yike-design-ui/components/button/style/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@import '../../styles/mixin.less';
@import './variables.less';

@typeList: secondary, outline;
@statusList: primary, success, warning, danger;
@sizeList: s, m, xl;

.yk-button {
display: inline-flex;
justify-content: center;
Expand All @@ -12,7 +16,6 @@
box-sizing: border-box;
cursor: pointer;
user-select: none;

.btn-type();
.btn-size();

Expand All @@ -32,6 +35,13 @@
}
}

// yk-button--[status]
each(@statusList, {
&--@{value} {
.btn-status(primary, @value);
}
});

.genTypeAndStatus();
.gen-size();

Expand All @@ -57,8 +67,6 @@
}

.genTypeAndStatus() {
@typeList: secondary, outline;

each(@typeList, {
&--@{value} {
.btn-type(@value);
Expand All @@ -74,15 +82,10 @@
&--@{type}.yk-button--@{value} {
.btn-status(@type, @value);
}
&--@{value} {
.btn-status(primary, @value);
}
});
}

.gen-size() {
@sizeList: s, m, xl;

each(@sizeList, {
&--@{value} {
.btn-size(@value);
Expand Down

0 comments on commit f70340e

Please sign in to comment.