Skip to content

Commit

Permalink
feat(styles): support prefixCls
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Dec 29, 2020
1 parent 55821bc commit fe53ac4
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 61 deletions.
15 changes: 10 additions & 5 deletions packages/antd/src/array-cards/style.less
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
@import '~antd/lib/style/themes/default.less';

.ant-array-cards-remove {
@array-cards-prefix-cls: ~'@{ant-prefix}-array-cards';

.@{array-cards-prefix-cls}-remove {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
margin-left: 6px;

&:hover {
color: @primary-5;
}
}

.ant-array-cards-addition {
.@{array-cards-prefix-cls}-addition {
transition: all .25s ease-in-out;
}


.ant-array-cards-move-down {
.@{array-cards-prefix-cls}-move-down {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
margin-left: 6px;

&:hover {
color: @primary-5;
}
}

.ant-array-cards-move-up {
.@{array-cards-prefix-cls}-move-up {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
margin-left: 6px;

&:hover {
color: @primary-5;
}
}


.ant-array-cards-item {
.@{array-cards-prefix-cls}-item {
margin-bottom: 10px !important;
}
74 changes: 38 additions & 36 deletions packages/antd/src/array-items/style.less
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
@import '~antd/lib/style/themes/default.less';

.ant-array-items {
.ant-array-items-remove {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;

&:hover {
color: @primary-5;
}
}

.ant-array-items-addition {
transition: all .25s ease-in-out;
}

@array-items-prefix-cls: ~'@{ant-prefix}-array-items';

.ant-array-items-move-down {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
.@{array-items-prefix-cls}-remove {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;

&:hover {
color: @primary-5;
}
&:hover {
color: @primary-5;
}
}

.ant-array-items-move-up {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
.@{array-items-prefix-cls}-addition {
transition: all .25s ease-in-out;
}

&:hover {
color: @primary-5;
}
}

.ant-array-items-sort-handler {
cursor: move;
color: #888 !important;
.@{array-items-prefix-cls}-move-down {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;

&:hover {
color: @primary-5;
}
}

.@{array-items-prefix-cls}-move-up {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;

.ant-array-items-item-inner {
visibility: visible;
&:hover {
color: @primary-5;
}
}

.@{array-items-prefix-cls}-sort-handler {
cursor: move;
color: #888 !important;
}

.ant-array-items-card {
.@{array-items-prefix-cls}-item-inner {
visibility: visible;
}


.@{array-items-prefix-cls}-card {
display: flex;
border: 1px solid #eee;
margin-bottom: 10px;
padding: 3px 6px;
background: #fff;
justify-content: space-between;

.ant-form-item {
.@{ant-prefix}-form-item {
margin-bottom: 0;
}

Expand All @@ -64,4 +65,5 @@
&:hover {
border: 1px solid #aaa;
}

}
26 changes: 14 additions & 12 deletions packages/antd/src/array-table/style.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import '~antd/lib/style/themes/default.less';

.ant-array-table {
.ant-array-table-remove {
@array-table-prefix-cls: ~'@{ant-prefix}-array-table';

.@{array-table-prefix-cls} {
.@{array-table-prefix-cls}-remove {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
Expand All @@ -12,7 +14,7 @@
}
}

.ant-array-table-addition {
.@{array-table-prefix-cls}-addition {
transition: all .25s ease-in-out;
}

Expand All @@ -22,7 +24,7 @@
}
}

.ant-array-table-move-down {
.@{array-table-prefix-cls}-move-down {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
Expand All @@ -33,7 +35,7 @@
}
}

.ant-array-table-move-up {
.@{array-table-prefix-cls}-move-up {
transition: all .25s ease-in-out;
color: @text-color;
font-size: 16px;
Expand All @@ -44,30 +46,30 @@
}
}

.ant-array-table-sort-handler {
.@{array-table-prefix-cls}-sort-handler {
cursor: move;
color: #888 !important;
}

.ant-array-table-pagination {
.@{array-table-prefix-cls}-pagination {
display: flex;
justify-content: center;

.ant-array-table-status-select.has-error {
.@{array-table-prefix-cls}-status-select.has-error {
.ant-select-selector {
border-color: @error-color !important;
}
}
}

.ant-table {
.@{ant-prefix}-table {
td {
visibility: visible;

.ant-form-item {
.@{ant-prefix}-form-item {
margin-bottom: 0 !important;

.ant-form-item-explain {
.@{ant-prefix}-form-item-explain {
position: absolute;
font-size: 12px;
top: 100%;
Expand All @@ -83,7 +85,7 @@
}
}

.ant-array-table-sort-helper {
.@{array-table-prefix-cls}-sort-helper {
background: #fff;
border: 1px solid #eee;
z-index: 10;
Expand Down
18 changes: 10 additions & 8 deletions packages/antd/src/editable/style.less
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
@import '~antd/lib/style/themes/default.less';

.ant-editable {
@editable-prefix-cls: ~'@{ant-prefix}-editable';

.@{editable-prefix-cls} {
cursor: pointer;

.ant-form-text {
.ant-tag {
.@{ant-prefix}-form-text {
.@{ant-prefix}-tag {
transition: none !important;
}

.ant-tag:last-child {
.@{ant-prefix}-tag:last-child {
margin-right: 0 !important;
}
}

.ant-editable-edit-btn,
.ant-editable-close-btn {
.@{editable-prefix-cls}-edit-btn,
.@{editable-prefix-cls}-close-btn {
transition: all .25s ease-in-out;
color: #aaa;
font-size: 12px;
Expand All @@ -24,12 +26,12 @@
}
}

.ant-form-text {
.@{ant-prefix}-form-text {
display: flex;
align-items: center;
}

.ant-editable-preview {
.@{editable-prefix-cls}-preview {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
Expand Down

0 comments on commit fe53ac4

Please sign in to comment.