refactor(empty): migrate css var (#2644)

This commit is contained in:
云游君 2021-07-23 23:14:07 +08:00 committed by GitHub
parent 741fd86f1d
commit e3bf8ad3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View File

@ -662,10 +662,8 @@ $--form-label-font-size: map.get($--font-size, 'base') !default;
/* Empty
-------------------------- */
$--empty-padding: 40px 0 !default;
$--empty-image-width: 160px !default;
$--empty-description-margin-top: 20px !default;
$--empty-bottom-margin-top: 20px !default;
// refactor with css3 var
// See packages/theme-chalk/src/empty.scss
/* Descriptions
-------------------------- */

View File

@ -1,6 +1,13 @@
@import 'mixins/mixins';
@import 'common/var';
:root {
--el-empty-padding: 40px 0;
--el-empty-image-width: 160px;
--el-empty-description-margin-top: 20px;
--el-empty-bottom-margin-top: 20px;
}
@include b(empty) {
display: flex;
justify-content: center;
@ -8,10 +15,10 @@
flex-direction: column;
text-align: center;
box-sizing: border-box;
padding: $--empty-padding;
padding: var(--el-empty-padding);
@include e(image) {
width: $--empty-image-width;
width: var(--el-empty-image-width);
img {
user-select: none;
@ -30,16 +37,16 @@
}
@include e(description) {
margin-top: $--empty-description-margin-top;
margin-top: var(--el-empty-description-margin-top);
p {
margin: 0;
font-size: var(--el-font-size-base);
color: $--color-text-secondary;
color: var(--el-color-text-secondary);
}
}
@include e(bottom) {
margin-top: $--empty-bottom-margin-top;
margin-top: var(--el-empty-bottom-margin-top);
}
}