amis2/scss/components/_card.scss
2021-11-11 11:46:37 +08:00

219 lines
4.4 KiB
SCSS

.#{$ns}Card {
background: var(--Card-bg);
border: var(--Card-borderWidth) solid var(--Card-borderColor);
border-radius: var(--Card-borderRadius);
margin-bottom: var(--gap-base);
position: relative;
display: flex;
flex-direction: column;
width: 100%;
&--link {
cursor: pointer;
}
&-title {
color: var(--text--loud-color);
font-size: var(--fontSizeMd);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&-subTitle {
// white-space: nowrap;
max-height: calc(var(--fontSizeBase) * var(--lineHeightBase) * 2);
overflow: hidden;
text-overflow: ellipsis;
color: var(--text--muted-color);
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
display: -webkit-box;
}
&-title + &-subTitle {
margin-top: var(--gap-xs);
}
&-dragBtn {
cursor: pointer;
float: right;
margin: var(--gap-sm);
}
&-heading {
display: flex;
flex-direction: row;
padding: var(--gap-sm) var(--gap-base);
flex: 1 0 auto;
}
&-avtar {
float: left;
margin-right: var(--gap-base);
max-width: px2rem(200px);
img {
max-width: 100%;
}
}
&-avtarText {
background: var(--primary);
color: var(--white);
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
vertical-align: middle;
border-radius: 500px;
float: left;
margin-right: var(--gap-base);
font-size: var(--fontSizeXl);
text-transform: uppercase();
}
&-meta {
display: block;
flex-grow: 1;
height: 100%;
position: relative;
margin-right: var(--gap-md);
}
&-toolbar {
margin-right: calc(-1 * var(--gap-base));
text-align: right;
}
&-highlight {
background: var(--success);
width: px2rem(8px);
height: px2rem(8px);
border-radius: 100%;
display: inline-block;
position: absolute;
top: var(--gap-xs);
right: px2rem(2px);
}
&-body {
padding: var(--gap-base);
flex: 1 0 auto;
}
&-heading + &-body {
padding-top: var(--gap-xs);
}
&-field {
position: relative;
display: flex;
flex-wrap: nowrap;
}
&-fieldValue {
position: relative;
flex-basis: 0;
flex-grow: 1;
width: 0;
text-overflow: ellipsis;
overflow: hidden;
}
&-fieldLabel {
width: px2rem(60px);
color: var(--text--muted-color);
}
&-actions {
border-top: var(--Card-borderWidth) solid var(--Card-actions-borderColor);
display: flex;
flex-direction: row;
width: 100%;
table-layout: fixed;
> a {
background: transparent;
flex-grow: 1;
border-color: var(--Card-actions-borderColor);
border-style: solid;
border-width: 0 var(--Card-borderWidth) 0 0;
color: var(--text-color);
text-align: center;
line-height: px2rem(40px);
font-size: var(--Card-actions-fontSize);
&:not(.is-disabled) {
cursor: pointer;
&:hover {
background: var(--Card-actions-onHover-bg);
color: var(--Card-actions-onHover-color);
text-decoration: none;
}
}
&:last-child {
border: none;
}
&.is-disabled {
color: var(--text--muted-color);
&:hover {
text-decoration: none;
}
}
}
}
&.is-checked {
background: var(--Card-onChecked-bg);
border-color: var(--Card-onChecked-borderColor);
color: var(--Card-onChecked-color);
.#{$ns}Card-actions,
.#{$ns}Card-actions > a {
border-color: var(--Card-onChecked-borderColor);
color: var(--Card-onChecked-color);
}
.#{$ns}Card-fieldLabel {
color: var(--Card-onChecked-fieldLabel-color);
}
.#{$ns}Card-actions > a:hover {
background: var(--Card-actions-onChecked-onHover-bg);
color: var(--Card-actions-onChecked-onHover-color);
}
}
&.is-modified,
&.is-moved {
background: var(--Card-onModified-bg);
border-color: var(--Card-onModified-borderColor);
color: var(--Card-onModified-color);
.#{$ns}Card-actions,
.#{$ns}Card-actions > a {
border-color: var(--Card-onModified-borderColor);
color: var(--Card-onModified-color);
}
.#{$ns}Card-fieldLabel {
color: var(--Card-onModified-fieldLabel-color);
}
.#{$ns}Card-actions > a:hover {
background: var(--Card-onModified-onHover-bg);
color: var(--Card-onModified-onHover-color);
}
}
.is-dragging > & {
opacity: var(--Card-onDragging-opacity);
}
}