amis/scss/components/_card.scss

220 lines
4.2 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}Card {
2019-12-06 09:58:08 +08:00
background-color: $Card-bg;
border: $Card-borderWidth solid $Card-borderColor;
border-radius: $Card-borderRadius;
margin-bottom: $gap-base;
position: relative;
2019-12-24 11:25:55 +08:00
display: flex;
flex-direction: column;
width: 100%;
2019-12-06 09:58:08 +08:00
&-title {
color: $text--loud-color;
font-size: $fontSizeMd;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&-subTitle {
2019-12-24 11:25:55 +08:00
// white-space: nowrap;
max-height: $fontSizeBase * $lineHeightBase * 2;
2019-12-06 09:58:08 +08:00
overflow: hidden;
text-overflow: ellipsis;
color: $text--muted-color;
2019-12-24 11:25:55 +08:00
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
display: -webkit-box;
}
&-title + &-subTitle {
margin-top: $gap-xs;
2019-12-06 09:58:08 +08:00
}
&-checkBtn {
position: absolute;
top: 0;
right: 0;
margin: $gap-sm;
z-index: 1;
.#{$ns}Checkbox {
margin-right: 0;
}
}
&-dragBtn {
cursor: pointer;
float: right;
margin: $gap-sm;
}
&-heading {
overflow: hidden;
padding: $gap-sm $gap-base;
2019-12-24 11:25:55 +08:00
flex: 1 0 auto;
2019-12-06 09:58:08 +08:00
}
&-avtar {
float: left;
margin-right: $gap-base;
max-width: px2rem(200px);
img {
max-width: 100%;
}
}
2020-03-05 20:36:07 +08:00
&-avtarText {
background-color: $primary;
color: $white;
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
vertical-align: middle;
border-radius: 500px;
float: left;
margin-right: $gap-base;
font-size: $fontSizeXl;
text-transform: uppercase();
}
2019-12-06 09:58:08 +08:00
&-meta {
display: block;
height: 100%;
overflow: hidden;
2019-04-30 11:11:25 +08:00
position: relative;
2019-12-06 09:58:08 +08:00
margin-right: $gap-md;
}
&-highlight {
background-color: $success;
width: px2rem(8px);
height: px2rem(8px);
border-radius: 100%;
display: inline-block;
position: absolute;
top: px2rem(5px);
right: px2rem(2px);
}
&-body {
padding: $gap-base;
2019-12-24 11:25:55 +08:00
flex: 1 0 auto;
2019-12-06 09:58:08 +08:00
}
&-heading + &-body {
padding-top: $gap-xs;
}
&-field {
position: relative;
display: flex;
flex-wrap: nowrap;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fieldValue {
position: relative;
flex-basis: 0;
flex-grow: 1;
2019-12-12 17:16:27 +08:00
width: 0;
2019-12-24 11:25:55 +08:00
text-overflow: ellipsis;
overflow: hidden;
2019-12-06 09:58:08 +08:00
}
&-fieldLabel {
width: px2rem(60px);
color: $text--muted-color;
}
&-actions {
border-top: $Card-borderWidth solid $Card-actions-borderColor;
display: table;
width: 100%;
2020-02-09 16:57:30 +08:00
table-layout: fixed;
2019-12-06 09:58:08 +08:00
> a {
background-color: transparent;
display: table-cell;
border-color: $Card-actions-borderColor;
border-style: solid;
border-width: 0 $Card-borderWidth 0 0;
color: $text-color;
text-align: center;
line-height: px2rem(40px);
// font-size: $fontSizeBase;
2019-12-06 15:22:17 +08:00
&:not(.is-disabled) {
2019-04-30 11:11:25 +08:00
cursor: pointer;
2019-12-06 15:22:17 +08:00
&:hover {
background-color: $Card-actions-onHover-bg;
color: $Card-actions-onHover-color;
text-decoration: none;
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:last-child {
border: none;
}
2019-04-30 11:11:25 +08:00
2019-12-06 15:22:17 +08:00
&.is-disabled {
color: $text--muted-color;
&:hover {
text-decoration: none;
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-checked {
background-color: $Card-onChecked-bg;
border-color: $Card-onChecked-borderColor;
color: $Card-onChecked-color;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}Card-actions,
.#{$ns}Card-actions > a {
border-color: $Card-onChecked-borderColor;
color: $Card-onChecked-color;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Card-fieldLabel {
color: lighten($Card-onChecked-color, 20%);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Card-actions > a:hover {
background-color: $Card-actions-onChecked-onHover-bg;
color: darken($Card-onChecked-color, 10%);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-modified,
&.is-moved {
background-color: $Card-onModified-bg;
border-color: $Card-onModified-borderColor;
color: $Card-onModified-color;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.#{$ns}Card-actions,
.#{$ns}Card-actions > a {
border-color: $Card-onModified-borderColor;
color: $Card-onModified-color;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Card-fieldLabel {
color: lighten($Card-onModified-color, 20%);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Card-actions > a:hover {
background-color: darken($Card-onModified-bg, 5%);
color: darken($Card-onModified-color, 10%);
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.is-dragging > & {
opacity: $Card-onDragging-opacity;
}
}