scinote-web/app/assets/stylesheets/shared/dropdown_selector.scss
Anton Ignatov 5b8e1fedf1 Fix markup
2019-11-18 13:59:54 +01:00

257 lines
4.8 KiB
SCSS

// scss-lint:disable SelectorDepth
// scss-lint:disable NestingDepth
@import "constants";
.dropdown-selector-container {
display: inline-block;
float: left;
position: relative;
width: 100%;
.input-field {
align-items: center;
background: $color-white;
border: 1px solid $color-alto;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
min-height: 36px;
overflow: hidden;
padding: 3px 36px 3px 3px;
position: relative;
transition: .2s;
width: 100%;
.fa-caret-down {
color: $color-silver-chalice;
cursor: pointer;
font-size: 20px;
line-height: 18px;
position: absolute;
right: 8px;
text-align: center;
top: 8px;
width: 18px;
}
.search-field {
border: 0;
flex-basis: 50px;
flex-grow: 2000;
line-height: 24px;
min-width: 50px;
outline: 0;
padding-left: 5px;
&::placeholder {
opacity: .7;
}
}
.ds-tags {
align-items: center;
background: $color-concrete;
border-radius: 12px;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, .1);
display: flex;
flex-shrink: 0;
line-height: 13px;
margin: 2px 3px;
max-width: calc(100% - 6px);
padding: 5px 7px;
user-select: none;
.tag-label {
display: inline-block;
margin-bottom: 1px;
margin-right: 5px;
max-width: 500px;
overflow: hidden;
transition: .3s;
white-space: nowrap;
width: auto;
&.closing {
margin-right: 0;
max-width: 0;
}
}
.fas {
cursor: pointer;
flex-grow: 1;
font-size: 13px;
opacity: .7;
text-align: right;
}
}
}
.dropdown-container {
background: $color-white;
border: 1px solid $color-alto;
border-radius: 0 0 4px 4px;
box-shadow: 0 0 0 0 rgba(0, 0, 0, .2);
display: none;
overflow: hidden;
position: absolute;
top: calc(100% - 30px);
transition: .2s;
transition-property: top, bottom, box-shadow;
width: 100%;
z-index: 10;
.empty-dropdown {
opacity: .6;
padding: 7px;
text-align: center;
}
.dropdown-select-all {
background: $color-white;
border: 0;
border-bottom: 1px solid $color-alto;
border-radius: 0;
cursor: pointer;
font-weight: bold;
line-height: 20px;
padding: 5px;
position: sticky;
text-align: center;
top: 0;
width: 100%;
z-index: 5;
}
.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);
margin-bottom: 0;
top: auto;
}
}
&.open {
.input-field {
border-bottom: 1px solid $brand-primary;
border-radius: 4px 4px 0 0;
z-index: 12;
.fa-caret-down {
transform: rotate(180deg);
}
}
.dropdown-container {
border-top: 0;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .2);
display: block;
top: 100%;
}
&.inverse {
.input-field {
border-bottom: 1px solid $color-alto;
border-radius: 0 0 4px 4px;
border-top: 1px solid $brand-primary;
}
.dropdown-container {
border-bottom: 0;
border-radius: 4px 4px 0 0;
bottom: 100%;
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .2);
position: fixed;
top: auto;
}
}
}
&.disabled {
.input-field {
background: $color-concrete;
.search-field:disabled {
background: inherit;
user-select: none;
}
}
}
}