naive-ui/styles/Card.scss

184 lines
5.2 KiB
SCSS

@import './mixins/mixins.scss';
@mixin card-size-mixin ($size) {
@include m($size + '-size') {
@include m(content-segmented) {
& > {
@include e(content) {
padding-top: map-get($--n-card-margin-bottom, $size);
}
}
}
@include m(content-soft-segmented) {
& > {
@include e(content) {
padding-bottom: map-get($--n-card-margin-bottom, $size);
margin: 0 map-get($--n-card-margin-left, $size);
padding-top: map-get($--n-card-margin-bottom, $size);
}
}
}
@include m(footer-segmented) {
& > {
@include e(footer) {
padding-top: map-get($--n-card-margin-bottom, $size);
}
}
}
@include m(footer-soft-segmented) {
& > {
@include e(footer) {
padding-bottom: map-get($--n-card-margin-bottom, $size);
margin: 0 map-get($--n-card-margin-left, $size);
padding-top: map-get($--n-card-margin-bottom, $size);
}
}
}
& > {
@include b(card-header) {
padding:
map-get($--n-card-margin-top, $size)
map-get($--n-card-margin-left, $size)
map-get($--n-card-margin-bottom, $size)
map-get($--n-card-margin-left, $size);
@include e(main) {
font-size: map-get($--n-card-font-size, $size);
}
@include e(extra) {
font-size: 14px;
}
}
@include e(content, footer) {
padding: 0 map-get($--n-card-margin-left, $size) map-get($--n-card-margin-bottom, $size) map-get($--n-card-margin-left, $size) ;
font-size: 14px;
}
@include e(action) {
background-color: $--card-action-background-color;
padding: map-get($--n-card-margin-bottom, $size) map-get($--n-card-margin-left, $size);
font-size: 14px;
}
}
}
}
@include themes-mixin {
@include b(card) {
@include once {
display: block;
width: 100%;
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;
border-radius: $--n-card-border-radius;
@include card-size-mixin('small');
@include card-size-mixin('medium');
@include card-size-mixin('large');
@include card-size-mixin('huge');
@include b(card-cover) {
$border-radius: $--n-card-border-radius - 1px;
overflow: hidden;
border-radius: $border-radius $border-radius 0 0;
width: 100%;
img {
display: block;
width: 100%;
}
}
}
background-color: $--card-background-color;
color: $--card-text-color;
@include m(bordered) {
border: 1px solid $--card-border-color;
}
@include m(action-segmented) {
& > {
@include e(action) {
&:not(:first-child) {
border-top: 1px solid $--card-border-color;
}
}
}
}
@include m(content-segmented, content-soft-segmented) {
& > {
@include e(content) {
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
}
&:not(:first-child) {
border-top: 1px solid $--card-border-color;
}
}
}
}
@include m(footer-segmented, footer-soft-segmented) {
& > {
@include e(footer) {
@include once {
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
}
&:not(:first-child) {
border-top: 1px solid $--card-border-color;
}
}
}
}
@include once {
& > {
@include e(content) {
box-sizing: border-box;
line-height: 1.75;
font-size: 14px;
}
@include e(footer) {
box-sizing: border-box;
line-height: 1.75;
font-size: 14px;
}
}
}
& > {
@include b(card-header) {
@include once {
box-sizing: border-box;
display: flex;
align-items: center;
}
@include e(main) {
@include once {
font-weight: $--n-strong-weight;
font-size: 18px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
flex: 1;
}
color: $--card-title-text-color;
}
@include e(extra) {
@include once {
font-weight: 400;
font-size: 14px;
transition: color .3s $--n-ease-in-out-cubic-bezier;
}
color: $--card-text-color;
}
@include e(close-mark) {
@include once {
cursor: pointer;
transition: fill .3s $--n-ease-in-out-cubic-bezier;
}
fill: $--card-close-fill;
}
}
@include e(action) {
@include once {
box-sizing: border-box;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
line-height: 1.75;
font-size: 14px;
background-clip: padding-box;
}
background-color: $--card-action-background-color;
}
}
}
}