naive-ui/styles/Card.scss

207 lines
5.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) {
2019-11-29 14:45:32 +08:00
@include b(card-header) {
2019-11-13 00:02:42 +08:00
&: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) {
2019-11-29 14:45:32 +08:00
@include b(card-header) {
2019-11-15 17:44:43 +08:00
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-29 14:45:32 +08:00
@include m(footer-segmented) {
@include e(footer) {
2019-11-13 00:02:42 +08:00
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: map-get($--card-margin-bottom, $size);
}
}
}
2019-11-29 14:45:32 +08:00
@include m(footer-soft-segmented) {
@include e(footer) {
2019-11-15 17:44:43 +08:00
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-29 14:45:32 +08:00
@include b(card-header) {
2019-11-13 00:02:42 +08:00
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;
}
}
2019-11-29 14:45:32 +08:00
@include e(content, footer) {
2019-11-13 00:02:42 +08:00
padding: 0px map-get($--card-margin-left, $size);
margin: map-get($--card-margin-bottom, $size) 0;
font-size: 14px;
}
@include e(action) {
2019-11-29 14:45:32 +08:00
background-color: $--card-action-background-color;
2019-11-13 00:02:42 +08:00
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) {
2019-11-29 14:45:32 +08:00
@include once {
display: block;
overflow: hidden;
2019-11-13 00:02:42 +08:00
width: 100%;
2019-11-29 14:45:32 +08:00
box-sizing: border-box;
position: relative;
transition: color .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
border-radius: 6px;
@include card-size-mixin('small');
@include card-size-mixin('medium');
@include card-size-mixin('large');
@include card-size-mixin('huge');
@include b(card-cover) {
2019-11-13 00:02:42 +08:00
width: 100%;
2019-11-29 14:45:32 +08:00
img {
display: block;
width: 100%;
}
2019-11-13 00:02:42 +08:00
}
}
2019-11-29 14:45:32 +08:00
background-color: $--card-background-color;
color: $--card-text-color;
@include m(bordered) {
border: 1px solid $--card-border-color;
}
2019-11-15 17:44:43 +08:00
@include m(title-segmented, title-soft-segmented) {
2019-11-29 14:45:32 +08:00
@include b(card-header) {
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
}
2019-11-13 00:02:42 +08:00
&:not(:last-child) {
2019-11-29 14:45:32 +08:00
border-bottom: 1px solid $--card-border-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) {
2019-11-29 14:45:32 +08:00
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
}
2019-11-13 00:02:42 +08:00
&:not(:last-child) {
2019-11-29 14:45:32 +08:00
border-bottom: 1px solid $--card-border-color;
2019-11-13 00:02:42 +08:00
}
}
}
2019-11-29 14:45:32 +08:00
@include m(footer-segmented, footer-soft-segmented) {
@include e(footer) {
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
}
2019-11-13 00:02:42 +08:00
&:not(:last-child) {
2019-11-29 14:45:32 +08:00
border-bottom: 1px solid $--card-border-color;
2019-11-13 00:02:42 +08:00
}
}
}
2019-11-29 14:45:32 +08:00
@include b(card-header) {
@include once {
box-sizing: border-box;
display: flex;
align-items: center;
}
2019-11-13 00:02:42 +08:00
@include e(main) {
2019-11-29 14:45:32 +08:00
@include once {
font-weight: 700;
font-size: 18px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
flex: 1;
}
color: $--card-title-text-color;
2019-11-13 00:02:42 +08:00
}
@include e(extra) {
2019-11-29 14:45:32 +08:00
@include once {
font-weight: 400;
font-size: 14px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
}
color: $--card-text-color;
2019-11-13 00:02:42 +08:00
}
2019-11-15 17:44:43 +08:00
@include e(close-mark) {
2019-11-29 14:45:32 +08:00
@include once {
cursor: pointer;
transition: fill .3s $--n-ease-in-out-cubic-bezier
2019-11-29 14:45:32 +08:00
}
2019-12-08 20:47:14 +08:00
fill: $--card-close-fill;
2019-11-15 17:44:43 +08:00
}
2019-11-13 00:02:42 +08:00
}
2019-11-29 14:45:32 +08:00
@include once {
@include e(content) {
line-height: 1.5;
font-size: 14px;
}
@include e(footer) {
line-height: 1.5;
font-size: 14px;
}
2019-11-13 00:02:42 +08:00
}
@include e(action) {
2019-11-29 14:45:32 +08:00
@include once {
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
2019-11-29 14:45:32 +08:00
line-height: 1.5;
font-size: 14px;
}
background-color: $--card-action-background-color;
2019-11-13 00:02:42 +08:00
}
}
}