discourse/app/assets/stylesheets/common/select-kit/combo-box.scss
Joffrey JAFFEUX 0431942f3d
DEV: select-kit 2 (#7998)
This new iteration of select-kit focuses on following best principales and disallowing mutations inside select-kit components. A best effort has been made to avoid breaking changes, however if you content was a flat array, eg: ["foo", "bar"] You will need to set valueProperty=null and nameProperty=null on the component.

Also almost every component should have an `onChange` handler now to decide what to do with the updated data. **select-kit will not mutate your data by itself anymore**
2020-02-03 14:22:14 +01:00

123 lines
2.2 KiB
SCSS

.select-kit {
&.combo-box {
.select-kit-body {
border-radius: 0;
box-shadow: shadow("dropdown");
}
.select-kit-row {
margin: 0;
min-height: 1px;
padding: 6px 10px;
&.no-content {
font-weight: normal;
}
}
.select-kit-filter {
.filter-input,
.filter-input:focus,
.filter-input:active {
flex: 1;
}
.filter-icon {
margin-left: 0.25em;
}
}
.select-kit-header {
background: $secondary;
border: 1px solid $primary-medium;
padding: 0 0.25em 0 0.5em;
font-weight: 500;
font-size: $font-0;
&.is-focused {
border: 1px solid $tertiary;
box-shadow: shadow("focus");
}
}
.select-kit-collection {
display: flex;
flex-direction: column;
padding: 0;
min-width: 100px;
max-height: 200px;
.collection-header {
a {
white-space: nowrap;
color: $primary;
line-height: $line-height-medium;
font-weight: bold;
display: block;
padding: 6px 10px;
color: $tertiary;
&:hover {
text-decoration: underline;
}
}
}
}
&.is-disabled {
.select-kit-header {
background: $primary-low;
border-color: $primary-low-mid;
color: $primary-medium;
.d-icon {
color: $primary-medium;
}
}
}
&.is-highlighted {
.select-kit-header {
border: 1px solid $tertiary;
box-shadow: shadow("focus");
}
}
&.is-expanded {
.select-kit-wrapper {
display: block;
border: 1px solid $tertiary;
box-shadow: shadow("focus");
}
}
&.is-expanded.is-above {
.select-kit-header {
border-radius: 0 0 3px 3px;
}
.select-kit-body {
border-radius: 3px 3px 0 0;
}
}
&.tag-drop,
&.group-dropdown {
min-width: auto;
}
&.tag-drop {
color: $primary-high;
}
&.group-dropdown {
.select-kit-row {
font-weight: bold;
}
}
&.is-expanded .select-kit-wrapper,
.select-kit-wrapper {
display: none;
}
}
}