naive-ui/styles/Card.scss

178 lines
4.4 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
2019-11-13 00:02:42 +08:00
$--card-margin-left: (
'small': 16px,
2019-11-15 17:44:43 +08:00
'medium': 24px,
'large': 32px,
'huge': 40px
2019-11-13 00:02:42 +08:00
);
2019-11-13 00:02:42 +08:00
$--card-margin-top: (
'small': 12px,
2019-11-15 17:44:43 +08:00
'medium': 16px,
'large': 20px,
'huge': 24px
2019-11-13 00:02:42 +08:00
);
2019-11-13 00:02:42 +08:00
$--card-margin-bottom: (
2019-11-15 17:44:43 +08:00
'small': 8px,
'medium': 12px,
'large': 16px,
'huge': 20px
2019-11-13 00:02:42 +08:00
);
2019-11-13 00:02:42 +08:00
@mixin card-size-mixin ($size) {
@include m($size + '-size') {
@include m(title-segmented) {
@include b(card-title) {
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-15 17:44:43 +08:00
@include m(title-soft-segmented) {
@include b(card-title) {
padding: map-get($--card-margin-top, $size) 0 map-get($--card-margin-bottom, $size) 0;
margin: 0 map-get($--card-margin-left, $size);
}
}
2019-11-13 00:02:42 +08:00
@include m(content-segmented) {
@include e(content) {
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-15 17:44:43 +08:00
@include m(content-soft-segmented) {
@include e(content) {
padding: 0;
margin: map-get($--card-margin-bottom, $size) map-get($--card-margin-left, $size);
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-13 00:02:42 +08:00
@include m(extra-segmented) {
@include e(extra) {
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-15 17:44:43 +08:00
@include m(extra-soft-segmented) {
@include e(extra) {
padding: 0;
margin: map-get($--card-margin-bottom, $size) map-get($--card-margin-left, $size);
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-13 00:02:42 +08:00
@include b(card-title) {
padding: 0px map-get($--card-margin-left, $size);
margin: map-get($--card-margin-top, $size) 0 map-get($--card-margin-bottom, $size) 0;
@include e(main) {
font-size: 18px;
}
@include e(extra) {
font-size: 14px;
}
}
@include e(content, extra) {
padding: 0px map-get($--card-margin-left, $size);
margin: map-get($--card-margin-bottom, $size) 0;
font-size: 14px;
}
@include e(action) {
background-color: $--n-table-header-color;
padding: map-get($--card-margin-bottom, $size) map-get($--card-margin-left, $size);
font-size: 14px;
}
}
2019-11-13 00:02:42 +08:00
}
2019-11-13 00:02:42 +08:00
@include themes-mixin {
@include b(card) {
display: block;
overflow: hidden;
width: 100%;
box-sizing: border-box;
position: relative;
2019-11-17 00:57:30 +08:00
background-color: $--n-card-color;
2019-11-15 17:44:43 +08:00
color: $--n-secondary-text-color;
2019-11-13 00:02:42 +08:00
@include m(bordered) {
2019-11-15 17:44:43 +08:00
border: 1px solid $--n-alpha-divider-color;
2019-11-13 00:02:42 +08:00
}
border-radius: 6px;
@include card-size-mixin('small');
@include card-size-mixin('medium');
2019-11-15 17:44:43 +08:00
@include card-size-mixin('large');
@include card-size-mixin('huge');
2019-11-13 00:02:42 +08:00
@include b(card-cover) {
width: 100%;
img {
display: block;
width: 100%;
}
}
2019-11-15 17:44:43 +08:00
@include m(title-segmented, title-soft-segmented) {
2019-11-13 00:02:42 +08:00
@include b(card-title) {
&:not(:last-child) {
2019-11-15 17:44:43 +08:00
border-bottom: 1px solid $--n-alpha-divider-color;
2019-11-13 00:02:42 +08:00
}
}
}
2019-11-15 17:44:43 +08:00
@include m(content-segmented, content-soft-segmented) {
2019-11-13 00:02:42 +08:00
@include e(content) {
&:not(:last-child) {
2019-11-15 17:44:43 +08:00
border-bottom: 1px solid $--n-alpha-divider-color;
2019-11-13 00:02:42 +08:00
}
}
}
2019-11-15 17:44:43 +08:00
@include m(extra-segmented, extra-soft-segmented) {
2019-11-13 00:02:42 +08:00
@include e(extra) {
&:not(:last-child) {
2019-11-15 17:44:43 +08:00
border-bottom: 1px solid $--n-alpha-divider-color;
2019-11-13 00:02:42 +08:00
}
}
}
@include b(card-title) {
box-sizing: border-box;
display: flex;
align-items: center;
@include e(main) {
font-weight: 700;
font-size: 18px;
color: $--n-text-color;
2019-11-15 17:44:43 +08:00
flex: 1;
2019-11-13 00:02:42 +08:00
}
@include e(extra) {
font-weight: 400;
font-size: 14px;
color: $--n-secondary-text-color;
}
2019-11-15 17:44:43 +08:00
@include e(close-mark) {
2019-11-17 00:57:30 +08:00
cursor: pointer;
2019-11-15 17:44:43 +08:00
fill: $--n-secondary-text-color;
}
2019-11-13 00:02:42 +08:00
}
@include e(content) {
line-height: 1.5;
font-size: 14px;
}
@include e(extra) {
line-height: 1.5;
font-size: 14px;
}
@include e(action) {
background-color: $--n-table-header-color;
line-height: 1.5;
font-size: 14px;
}
}
}