fleet/frontend/components/forms/fields/Dropdown/_styles.scss
2021-07-21 08:42:50 -07:00

267 lines
4.9 KiB
SCSS

.dropdown {
&__label {
display: block;
font-size: $small;
font-weight: $regular;
color: $core-fleet-black;
margin-bottom: $pad-xsmall;
&--error {
font-weight: $bold;
}
}
&__select {
&--error {
&.Select {
.Select-control {
color: $core-vibrant-red;
border: 1px solid $core-vibrant-red;
box-sizing: border-box;
border-radius: 4px;
}
.Select-arrow {
border-top-color: $ui-error;
}
}
}
}
&__option {
display: flex;
flex-direction: column;
}
&__help-text {
margin-top: $pad-xsmall;
font-size: $xx-small;
white-space: normal;
color: $core-fleet-blue;
font-style: italic;
}
}
.Select {
.Select-control {
border: 1px solid $ui-fleet-blue-15;
background-color: $ui-light-grey;
border-radius: $border-radius;
height: 40px;
.Select-value {
font-size: $x-small;
border-radius: 4px;
background-color: $ui-off-white;
border: solid 1px $core-dark-blue-grey;
&.is-focused {
border: 1px solid $core-vibrant-blue;
}
}
}
.Select-value {
font-size: $x-small;
border-radius: $border-radius;
background-color: $ui-off-white;
border: solid 1px $core-dark-blue-grey;
.Select-value-icon {
border: 0;
float: right;
position: relative;
line-height: 28px;
width: 20px;
padding: 0;
margin: 0 5px;
text-indent: -999em;
&::after {
transition: color 150ms ease-in-out;
content: url(../assets/images/icon-close-dark-blue-grey-16x16@2x.png);
transform: scale(0.5);
position: absolute;
top: -5px;
left: -5px;
visibility: visible;
font-size: $small;
color: $ui-gray;
text-indent: 0;
}
}
.Select-value-label {
font-size: $x-small;
color: $core-dark-blue-grey;
line-height: 28px;
}
}
&--single {
> .Select-control {
.Select-value {
line-height: 40px;
border: none;
top: 1px;
right: 1px;
left: 1px;
bottom: 1px;
}
}
}
.Select-arrow {
content: url("../assets/images/icon-chevron-black-16x16@2x.png");
height: 16px;
width: 16px;
margin-top: 8px;
margin-left: -4px;
border: none;
}
&.is-focused {
.Select-control {
border: 1px solid $core-vibrant-blue;
}
&:not(.is-open) {
.Select-control {
box-shadow: none;
}
}
}
&.is-open {
.Select-arrow {
content: url("../assets/images/icon-chevron-blue-16x16@2x.png");
height: 16px;
width: 16px;
margin-top: 12px;
margin-left: -4px;
border: none;
}
}
:hover {
.Select-arrow {
content: url("../assets/images/icon-chevron-blue-16x16@2x.png");
height: 16px;
width: 16px;
margin-left: -4px;
border: none;
}
&.is-open {
.Select-arrow {
content: url("../assets/images/icon-chevron-blue-16x16@2x.png");
height: 16px;
width: 16px;
margin-top: 10px;
margin-left: -4px;
border: none;
}
}
}
&.has-value {
> .Select-control,
&.is-pseudo-focused > .Select-control {
.Select-value {
.Select-value-label {
color: $core-dark-blue-grey;
font-size: $x-small;
}
}
}
}
.Select-menu-outer {
box-shadow: 0 4px 10px rgba(52, 59, 96, 0.15);
border-radius: 0 0 $border-radius $border-radius;
z-index: 6;
overflow: hidden;
border: 0;
margin: 0;
padding: $pad-small;
}
.Select-noresults {
font-size: $x-small;
}
.Select-option {
color: $core-fleet-black;
font-size: $x-small;
margin: 0;
padding: 6px $pad-medium;
display: block;
&.is-focused {
background-color: $ui-vibrant-blue-10;
.Select-icon {
color: $ui-vibrant-blue-10;
}
}
&:last-child {
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
&.is-disabled {
color: $ui-fleet-black-25;
.Select-icon {
visibility: hidden;
opacity: 0;
}
}
}
.Select-icon {
color: $ui-gray;
}
.Select-placeholder,
.Select-input {
color: $core-fleet-blue;
font-size: $small;
line-height: 40px;
padding: 0 12px;
box-sizing: border-box;
}
&.Select--multi {
.Select-control {
display: flex;
align-items: center;
height: auto;
min-height: 40px;
}
.Select-multi-value-wrapper {
flex-grow: 1;
padding: $pad-xsmall;
}
.Select-arrow-zone {
display: block;
}
.Select-option {
&.is-disabled {
color: $core-fleet-black;
cursor: default;
&.is-focused {
background-color: $ui-vibrant-blue-10;
color: $core-white;
}
}
}
.Select-value-label {
padding: 0 0 0 10px;
}
}
}