react-toolbox/components/dropdown/style.scss

104 lines
2.1 KiB
SCSS
Raw Normal View History

@import "../base";
@import "./config";
2015-10-20 22:38:33 +03:00
@import "../input/config";
2015-10-09 16:55:00 +03:00
.root {
position: relative;
width: inherit;
2015-10-20 22:38:33 +03:00
margin-bottom: $dropdown-offset;
color: $color-text;
cursor: pointer;
border-bottom: 1px solid $color-divider;
&:not(.active) {
> .values {
max-height: 0;
visibility: hidden;
}
}
2015-10-09 16:55:00 +03:00
&.active {
> .label, > .value {
opacity: .5;
2015-10-09 16:55:00 +03:00
}
> .values {
2015-10-20 22:38:33 +03:00
max-height: $dropdown-overflow-max-height;
visibility: visible;
box-shadow: $zdepth-shadow-1;
2015-10-09 16:55:00 +03:00
}
}
&.disabled {
color: $color-text-secondary;
pointer-events: none;
cursor: normal;
border-bottom-style: dotted;
2015-10-09 16:55:00 +03:00
> .value:after {
transform: scale(0);
2015-10-09 16:55:00 +03:00
}
}
&:not(.up) > .values {
top: 0;
bottom: auto;
}
&.up > .values {
top: auto;
bottom: 0;
}
2015-10-09 16:55:00 +03:00
}
.label {
font-size: $font-size-tiny;
color: $color-text-secondary;
2015-10-09 16:55:00 +03:00
}
.values {
position: absolute;
z-index: 2;
width: 100%;
overflow-x: hidden;
overflow-y: scroll;
list-style: none;
background-color: $dropdown-color-white;
2015-10-21 02:05:57 +03:00
border-radius: $dropdown-value-border-radius;
transition-timing-function: $animation-curve-default;
transition-duration: $animation-duration;
transition-property: max-height, box-shadow;
2015-10-09 16:55:00 +03:00
> * {
position: relative;
padding: $unit;
overflow: hidden;
cursor: pointer;
2015-10-09 16:55:00 +03:00
&:hover {
background-color: $dropdown-value-hover-background;
}
&.selected {
color: $dropdown-color-primary;
2015-10-09 16:55:00 +03:00
}
}
}
.value {
display: block;
2015-10-09 16:55:00 +03:00
> span {
2015-10-20 22:38:33 +03:00
display: inline-block;
height: $input-field-height;
font-size: $input-field-font-size;
line-height: $input-field-height;
2015-10-09 16:55:00 +03:00
}
> :not(span) {
2015-10-20 22:38:33 +03:00
margin: ($dropdown-offset / 2) 0;
2015-10-09 16:55:00 +03:00
}
&:after {
2015-10-20 22:38:33 +03:00
$size: ($input-field-height / 7);
$border: $size solid transparent;
position: absolute;
2015-10-20 22:38:33 +03:00
right: ($dropdown-offset / 2);
bottom: $dropdown-offset;
width: 0;
height: 0;
content: "";
border-top: $size solid $color-divider;
border-right: $border;
border-left: $border;
transition: transform $animation-duration $animation-curve-default;
2015-10-09 16:55:00 +03:00
}
}