amis/scss/components/_list.scss

178 lines
3.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;
flex-wrap: nowrap;
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 {
color: $text--loud-color;
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
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 {
cursor: pointer;
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-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;
}
}