amis/scss/components/_list.scss

234 lines
4.1 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}List {
2019-12-06 09:58:08 +08:00
border: $List-borderWidth solid $List-borderColor;
border-radius: $List-borderRadius;
background-color: $List-bg;
margin-bottom: $gap-md;
position: relative;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-toolbar {
@include clearfix();
display: flex;
2020-06-08 15:49:45 +08:00
flex-wrap: wrap;
2019-12-06 09:58:08 +08:00
padding: $List-toolbar-paddingY $List-toolbar-paddingX;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-actions {
display: inline-block;
2019-12-06 09:58:08 +08:00
> * {
margin-right: $Crud-toolbar-gap;
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
&-header {
padding: $List-toolbar-paddingY $List-toolbar-paddingX;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
> * + .#{$ns}Button,
> * + .#{$ns}ButtonGroup,
> * + .#{$ns}ButtonToolbar {
margin-left: $Crud-toolbar-gap;
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
&-header + &-toolbar {
padding-top: 0;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-heading {
padding: $gap-xs 0;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fixedTop {
position: absolute;
background: $white;
z-index: -1;
opacity: 0;
box-shadow: $List-fixedTop-boxShadow;
padding: $gap-sm;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.in {
position: fixed;
opacity: 1;
z-index: $zindex-affix;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}Cards-toolbar {
margin-bottom: 0;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
&:empty {
display: none;
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
&--unsaved &-heading {
background: $List--unsaved-heading-bg;
color: $List--unsaved-heading-color;
padding: $gap-xs $gap-sm;
margin-bottom: $gap-sm;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-dragTip {
2020-06-08 15:49:45 +08:00
width: 100%;
color: $info;
2019-12-06 09:58:08 +08:00
clear: both;
margin-top: $gap-xs;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-placeholder {
color: $text--muted-color;
text-align: center;
height: $List-placeholder-height;
line-height: $List-placeholder-height;
}
}
2019-04-30 11:11:25 +08:00
2020-06-08 13:55:05 +08:00
.#{$ns}ListGroup {
max-width: px2rem(400px);
display: flex;
flex-direction: column;
&-item {
position: relative;
display: block;
padding: $ListItem-paddingY $ListItem-paddingX;
margin-bottom: px2rem(-1px);
background-color: $white;
2020-06-23 13:32:21 +08:00
border: $ListItem-borderWidth solid $List-borderColor;
2020-06-08 13:55:05 +08:00
&:first-child {
border-top-left-radius: $borderRadius;
border-top-right-radius: $borderRadius;
}
&:last-child {
border-bottom-left-radius: $borderRadius;
border-bottom-right-radius: $borderRadius;
margin-bottom: 0;
}
&:hover {
// todo
z-index: 1;
}
&.is-active {
// todo
z-index: 2;
}
&.is-disabled {
color: $text--muted-color;
}
}
&--expanded {
.#{$ns}ListGroup-item {
border-radius: $borderRadius;
margin-bottom: $gap-sm;
&:last-child {
margin-bottom: 0;
}
}
}
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem {
@include clearfix();
& + & {
border-top: $ListItem-borderWidth solid $ListItem-borderColor;
}
position: relative;
display: block;
padding: $ListItem-paddingY $ListItem-paddingX;
&:nth-child(even) {
background-color: $ListItem--strip-bg;
}
&-checkBtn {
float: left;
margin-right: $gap-sm;
}
&-dragBtn {
2020-06-08 15:49:45 +08:00
cursor: move;
2019-12-06 09:58:08 +08:00
float: left;
margin-right: $gap-sm;
}
&-actions {
float: right;
}
&-title {
margin: 0;
padding: 0;
font-size: $fontSizeBase;
color: $text--loud-color;
font-weight: $fontWeightNormal;
}
&-content {
overflow: hidden;
}
&-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;
max-width: 100%;
2019-12-24 11:25:55 +08:00
width: 0;
overflow: hidden;
text-overflow: ellipsis;
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-fieldLabel {
width: px2rem(150px);
color: $text--muted-color;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-checked {
background-color: $ListItem-onChecked-bg;
border-color: $ListItem-onChecked-borderColor;
color: $ListItem-onChecked-color;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
+ .#{$ns}ListItem {
border-color: $ListItem-onChecked-borderColor;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem-fieldLabel {
color: lighten($ListItem-onChecked-color, 20%);
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: $ListItem-onModified-bg;
border-color: $ListItem-onModified-borderColor;
color: $ListItem-onModified-color;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
+ .#{$ns}ListItem {
border-color: $ListItem-onModified-borderColor;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.#{$ns}ListItem-fieldLabel {
color: lighten($ListItem-onModified-color, 20%);
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: $ListItem-onDragging-opacity;
}
}