discourse/app/assets/stylesheets/common/components/select-box.scss

298 lines
6.1 KiB
SCSS
Raw Normal View History

.mobile-view .select-box.is-expanded {
z-index: 1000;
}
.select-box {
border-radius: 3px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
2017-08-26 01:56:57 +08:00
display: inline-block;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
height: 34px;
min-width: 220px;
&.is-hidden {
display: none;
}
&.small {
height: 28px;
}
&.is-expanded {
z-index: 999;
.select-box-wrapper {
border: 1px solid $tertiary;
border-radius: 3px;
-webkit-box-shadow: $tertiary 0px 0px 6px 0px;
box-shadow: $tertiary 0px 0px 6px 0px;
}
.select-box-body {
border-radius: 3px 3px 0 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
left: 0;
position: absolute;
top: 0;
}
.collection, {
border-radius: inherit;
}
2017-08-26 01:56:57 +08:00
.select-box-header {
border-radius: 3px 3px 0 0;
}
&.is-above {
2017-08-26 01:56:57 +08:00
.select-box-header {
border-radius: 0 0 3px 3px;
}
}
}
&.is-highlighted {
.select-box-header {
border: 1px solid $tertiary;
-webkit-box-shadow: $tertiary 0px 0px 6px 0px;
box-shadow: $tertiary 0px 0px 6px 0px;
}
}
&.is-above {
.select-box-body {
bottom: 0;
top: auto;
}
.select-box-wrapper {
bottom: 0;
top: auto;
}
}
.d-icon {
2017-08-26 01:56:57 +08:00
opacity: 0.7;
}
.select-box-header {
background: $secondary;
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
border-radius: 3px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
outline: none;
2017-08-26 01:56:57 +08:00
display: flex;
2017-08-29 20:31:03 +08:00
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
2017-08-26 01:56:57 +08:00
justify-content: space-between;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
padding-left: 10px;
padding-right: 10px;
2017-09-07 22:56:00 +08:00
height: inherit;
&.is-focused {
border: 1px solid $tertiary;
border-radius: 3px;
-webkit-box-shadow: $tertiary 0px 0px 6px 0px;
box-shadow: $tertiary 0px 0px 6px 0px;
}
.current-selection {
text-align: left;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: inherit;
}
.icon {
margin-right: 5px;
}
.caret-icon {
margin-left: 5px;
pointer-events: none;
}
.d-button-label {
display: flex;
align-items: center;
white-space: nowrap;
overflow: hidden;
.d-icon {
margin-left: 5px;
margin-right: 0;
}
}
}
.select-box-body {
display: none;
width: 100%;
background: $secondary;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.select-box-row {
2017-08-29 20:31:03 +08:00
margin: 5px;
min-height: 1px;
cursor: pointer;
outline: none;
padding: 5px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
align-items: center;
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
.text {
margin: 0;
}
.d-icon {
margin-right: 5px;
}
&.is-highlighted {
background: $tertiary-low;
}
&.is-selected {
background: $highlight-medium;
}
&.is-selected.is-highlighted {
background: $tertiary-low;
}
}
.select-box-collection {
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-flex: 0;
-ms-flex: 0 1 auto;
flex: 0 1 auto;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
background: $secondary;
overflow-x: hidden;
overflow-y: auto;
border-radius: inherit;
margin: 0;
padding: 0;
-webkit-overflow-scrolling: touch;
.collection {
padding: 0;
margin: 0;
&:hover .select-box-row.is-highlighted:hover {
background: $tertiary-low;
}
}
&::-webkit-scrollbar {
-webkit-appearance: none;
width: 10px;
}
&::-webkit-scrollbar-thumb {
cursor: pointer;
border-radius: 5px;
background: dark-light-choose(scale-color($primary, $lightness: 50%), scale-color($secondary, $lightness: 50%));
}
&::-webkit-scrollbar-track {
background: transparent;
border-radius: 0;
}
}
.select-box-filter {
border-bottom: 1px solid $primary-low;
background: $secondary;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
padding: 0 10px;
.filter-query, .filter-query:focus, .filter-query:active {
background: none;
margin: 0;
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
outline: none;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
width: 100%;
padding: 5px 0;
}
}
.select-box-wrapper {
position: absolute;
top: 0;
left: 0;
background: none;
display: none;
-webkit-box-sizing: border-box;
box-sizing: border-box;
pointer-events: none;
border: 1px solid transparent;
}
.select-box-offscreen, .select-box .select-box-offscreen:focus {
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
border: 0;
margin: 0;
padding: 0;
overflow: hidden;
position: absolute;
outline: 0;
left: 0px;
top: 0px;
}
}