amis2/scss/components/form/_list.scss

123 lines
3.1 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}ListControl {
2019-12-06 09:58:08 +08:00
&-items {
display: block;
margin: calc(var(--ListControl-gutterWidth) / -2);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:empty {
display: none;
}
}
&-item {
position: relative;
user-select: none;
font-size: var(--ListControl-fontSize);
2019-12-06 09:58:08 +08:00
display: inline-block;
vertical-align: middle;
margin: calc(var(--ListControl-gutterWidth) / 2);
border: var(--ListControl-item-borderWidth) solid
var(--ListControl-item-borderColor);
background: var(--ListControl-item-bg);
padding: var(--ListControl-item-paddingY) var(--ListControl-item-paddingX);
color: var(--ListControl-item-color);
transition: var(--ListControl-item-transition);
max-width: calc(#{px2rem(200px)} + 2 * var(--ListControl-item-paddingX));
border-radius: var(--ListControl-item-borderRadius);
2019-12-06 09:58:08 +08:00
&:not(.is-disabled) {
cursor: pointer;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
.b-inherit {
border-color: var(--ListControl-item-color);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
@include hover {
background: var(--ListControl-item-onHover-bg);
border-color: var(--ListControl-item-onHover-borderColor);
color: var(--ListControl-item-onHover-color);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
.b-inherit {
border-color: var(--ListControl-item-onHover-borderColor);
2019-12-06 09:58:08 +08:00
}
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&:hover:active,
&.is-active {
background: var(--ListControl-item-onActive-bg);
border-color: var(--ListControl-item-onActive-borderColor);
color: var(--ListControl-item-onActive-color);
&:hover {
background: var(--ListControl-item-onActive-onHover-bg);
2019-12-06 09:58:08 +08:00
}
.b-inherit {
border-color: var(--ListControl-item-onActive-color);
2019-12-06 09:58:08 +08:00
}
&:before {
content: '';
position: absolute;
width: px2rem(14px);
height: px2rem(14px);
background: var(--ListControl-item-onActive-before-bg);
2019-12-06 09:58:08 +08:00
right: 0;
bottom: 0;
}
&:after {
content: '';
position: absolute;
width: px2rem(10px);
height: var(--gap-xs);
border-color: var(--ListControl-item-onActive-after-borderColor);
2019-12-06 09:58:08 +08:00
border-style: solid;
border-width: 0 0 px2rem(2px) px2rem(2px);
right: px2rem(1px);
bottom: var(--gap-xs);
2019-12-06 09:58:08 +08:00
transform: rotate(-40deg);
}
2019-04-30 11:11:25 +08:00
}
&.is-disabled {
pointer-events: none;
opacity: var(--ListControl-item-onDisabled-opacity);
border-color: var(--ListControl-item-onDisabled-borderColor);
&:before {
background: var(--ListControl-item-onDisabled-color);
}
background: var(--ListControl-item-onDisabled-bg);
color: var(--ListControl-item-onDisabled-color);
.b-inherit {
border-color: var(--ListControl-item-onDisabled-borderColor);
}
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-itemImage {
margin: calc(var(--ListControl-item-paddingY) * -1)
calc(var(--ListControl-item-paddingX) * -1);
2019-12-06 09:58:08 +08:00
img {
display: block;
max-width: 100%;
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
&-itemLabel {
text-align: center;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-itemImage + &-itemLabel {
margin-top: var(--ListControl-item-paddingY);
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-placeholder {
color: var(--Form-input-placeholderColor);
2019-12-06 09:58:08 +08:00
}
}