scinote-web/app/assets/stylesheets/shared/dropdown_selector.scss
2019-11-18 13:59:54 +01:00

139 lines
2.6 KiB
SCSS

@import "constants";
.dropdown-selector-container {
display: inline-block;
position: relative;
width: 100%;
.input-field {
background: $color-white;
border: 1px solid $color-alto;
border-radius: 4px;
min-height: 32px;
position: relative;
transition: .2s;
width: 100%;
z-index: 12;
}
.dropdown-container {
background: $color-white;
border: 1px solid $color-alto;
border-radius: 0 0 4px 4px;
border-top: 0;
box-shadow: 0px 0px 0px 0px rgba(0,0,0, 0.2);
display: none;
min-height: 100px;
overflow: hidden;
position: absolute;
top: calc(100% - 30px);
transition: .2s;
width: 100%;
z-index: 10;
.checkbox-icon {
&::before {
content: "\f0c8";
font-family: "Font Awesome 5 Free";
font-weight: 400;
margin: 2px 5px 0 0;
position: relative;
}
&.select {
&::before {
content: "\f14a";
}
}
}
.dropdown-option {
align-items: center;
cursor: pointer;
display: flex;
min-height: 32px;
padding: 0 10px;
position: relative;
user-select: none;
&.select {
background: $color-concrete;
}
&:hover {
background: $brand-primary;
color: $color-white;
}
}
.dropdown-group {
.group-name {
align-items: center;
cursor: pointer;
display: flex;
font-size: 14px;
font-weight: bold;
min-height: 32px;
padding: 0 10px;
user-select: none;
&:hover {
background: $brand-primary !important;
color: $color-white;
}
}
.dropdown-option {
padding-left: 20px;
}
&.select {
.group-name.checkbox-icon {
background: $color-concrete;
&::before {
content: "\f14a";
}
}
}
}
}
&.inverse {
.dropdown-container {
bottom: calc(100% - 30px);
top: auto;
}
}
&.open {
.input-field {
border-radius: 4px 4px 0 0;
border-bottom: 1px solid $brand-primary
}
.dropdown-container {
box-shadow: 0px 1px 2px 0px rgba(0,0,0, 0.2);
display: block;
top: 100%;
}
&.inverse {
.input-field {
border-radius: 0 0 4px 4px;
border-bottom: 1px solid $color-alto;
border-top: 1px solid $brand-primary
}
.dropdown-container {
border-radius: 4px 4px 0 0;
bottom: 100%;
box-shadow: 0px -1px 2px 0px rgba(0,0,0, 0.2);
top: auto;
}
}
}
}