feat(card): add var background-color & prepare for dark mode (#2912)

This commit is contained in:
云游君 2021-08-19 10:30:51 +08:00 committed by GitHub
parent 77a4cbf1b8
commit 47516e75ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View File

@ -4,10 +4,16 @@
@include b(card) {
@include set-component-css-var('card', $--card);
}
@include dark(card) {
@include set-component-css-var('card', $--dark-card);
}
@include b(card) {
border-radius: var(--el-card-border-radius);
border: 1px solid var(--el-card-border-color);
background-color: $--color-white;
background-color: var(--el-card-background-color);
overflow: hidden;
color: var(--el-text-color-primary);
transition: var(--el-transition-duration);

View File

@ -844,10 +844,19 @@ $--card: map.merge(
var(--el-border-color-light, map.get($--border-color, 'lighter')),
'border-radius': 4px,
'padding': 20px,
'background-color': var(--el-color-white),
),
$--card
);
$--dark-card: () !default;
$--dark-card: map.merge(
(
'background-color': var(--el-color-black),
),
$--dark-card
);
/* Slider
--------------------------*/
// css3 var in packages/theme-chalk/src/slider.scss

View File

@ -230,3 +230,12 @@
}
}
}
// dark
@mixin dark($block) {
.dark {
@include b($block) {
@content;
}
}
}