scinote-web/app/assets/stylesheets/shared/dropdown_selector.scss

218 lines
4.1 KiB
SCSS
Raw Normal View History

2019-08-02 21:57:41 +08:00
@import "constants";
.dropdown-selector-container {
display: inline-block;
2019-08-05 23:21:58 +08:00
float: left;
2019-08-02 21:57:41 +08:00
position: relative;
width: 100%;
.input-field {
2019-08-05 23:21:58 +08:00
align-items: center;
2019-08-02 21:57:41 +08:00
background: $color-white;
border: 1px solid $color-alto;
border-radius: 4px;
2019-08-05 23:21:58 +08:00
display: flex;
flex-wrap: wrap;
min-height: 36px;
2019-08-06 21:25:52 +08:00
overflow: hidden;
2019-08-05 23:21:58 +08:00
padding: 3px;
2019-08-02 21:57:41 +08:00
position: relative;
transition: .2s;
width: 100%;
2019-08-06 21:25:52 +08:00
.seacrh-field {
border: 0;
flex-basis: 50px;
flex-grow: 1;
flex-shrink: 1;
line-height: 24px;
min-width: 50px;
outline: 0;
padding-left: 5px;
&::placeholder {
opacity: 0.7;
}
}
2019-08-05 23:21:58 +08:00
.ds-tags {
align-items: center;
background: $color-concrete;
border-radius: 12px;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1);
display: flex;
2019-08-06 21:25:52 +08:00
flex-shrink: 0;
2019-08-05 23:21:58 +08:00
line-height: 14px;
margin: 2px 3px;
2019-08-06 21:25:52 +08:00
max-width: calc(100% - 6px);
2019-08-05 23:21:58 +08:00
padding: 5px 7px;
2019-08-06 21:25:52 +08:00
user-select: none;
&.stretch {
flex-grow: 1
}
2019-08-05 23:21:58 +08:00
.tag-label {
2019-08-06 21:25:52 +08:00
display: inline-block;
margin-bottom: 1px;
margin-right: 5px;
max-width: 500px;
overflow: hidden;
transition: .3s;
white-space: nowrap;
width: auto;
&.closing {
max-width: 0;
}
2019-08-05 23:21:58 +08:00
}
.fas {
cursor: pointer;
2019-08-06 21:25:52 +08:00
flex-grow: 1;
2019-08-05 23:21:58 +08:00
font-size: 14px;
opacity: 0.7;
2019-08-06 21:25:52 +08:00
text-align: right;
2019-08-05 23:21:58 +08:00
}
}
2019-08-02 21:57:41 +08:00
}
.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;
overflow: hidden;
position: absolute;
top: calc(100% - 30px);
transition: .2s;
width: 100%;
z-index: 10;
2019-08-06 21:25:52 +08:00
.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;
}
2019-08-02 21:57:41 +08:00
.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);
2019-08-06 21:25:52 +08:00
margin-bottom: 0;
2019-08-02 21:57:41 +08:00
top: auto;
}
}
&.open {
.input-field {
border-radius: 4px 4px 0 0;
2019-08-06 21:25:52 +08:00
border-bottom: 1px solid $brand-primary;
z-index: 12;
2019-08-02 21:57:41 +08:00
}
.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);
2019-08-06 21:25:52 +08:00
position: fixed;
2019-08-02 21:57:41 +08:00
top: auto;
}
}
}
}