discourse/app/assets/stylesheets/common/select-kit/select-kit.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

297 lines
5.1 KiB
SCSS
Raw Normal View History

.select-kit {
border: none;
box-sizing: border-box;
2017-08-26 01:56:57 +08:00
display: inline-block;
flex-direction: column;
position: relative;
2017-10-20 03:51:08 +08:00
vertical-align: middle;
user-select: none;
2017-10-20 03:51:08 +08:00
&.is-disabled {
pointer-events: none;
}
&.is-expanded {
z-index: z("dropdown");
.select-kit-body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.select-kit-collection {
border-radius: inherit;
box-sizing: border-box;
width: 100%;
}
}
&.is-loading {
.select-kit-collection {
overflow: hidden;
}
}
&.is-above {
.select-kit-filter {
border-top: 0;
}
.select-kit-wrapper {
bottom: 0;
top: auto;
}
}
.d-icon {
color: $primary-high;
}
.select-kit-header {
2017-11-10 02:57:53 +08:00
box-sizing: border-box;
overflow: hidden;
transition: all 0.25s;
cursor: pointer;
2017-08-26 01:56:57 +08:00
display: flex;
align-items: center;
flex-direction: row;
min-height: 30px;
.d-icon-spinner {
-webkit-animation: rotate-forever 1s infinite linear;
animation: rotate-forever 1s infinite linear;
}
2017-10-20 03:51:08 +08:00
.selected-name {
text-align: left;
flex: 0 1 auto;
align-items: center;
color: inherit;
display: flex;
outline: none;
.d-icon + .name {
margin-left: 0.5em;
}
.name {
display: inline-block;
> .d-icon {
margin-left: 0.5em;
margin-right: 0;
}
}
> .d-icon {
margin-right: 0;
}
&.select-kit-selected-color {
border-bottom-width: 5px;
border-bottom-style: solid;
}
}
2017-10-20 03:51:08 +08:00
.btn-clear {
margin-left: 0.25em;
padding: 0.25em;
2017-10-20 03:51:08 +08:00
border: 0;
background: none;
min-height: auto;
2017-10-20 03:51:08 +08:00
}
.icon {
margin-right: 5px;
}
.caret-icon {
margin-left: auto;
margin-right: 0;
padding-left: 5px;
pointer-events: none;
color: inherit;
}
.d-button-label {
display: flex;
align-items: center;
white-space: nowrap;
overflow: hidden;
2018-01-13 06:27:38 +08:00
line-height: $line-height-medium;
.d-icon {
margin-left: 5px;
margin-right: 0;
}
}
}
.select-kit-body {
display: none;
background: $secondary;
box-sizing: border-box;
}
.select-kit-row {
cursor: pointer;
outline: none;
display: flex;
flex: 1 0 auto;
box-sizing: border-box;
align-items: center;
justify-content: flex-start;
padding: 0.75em;
2017-10-20 03:51:08 +08:00
.name {
margin: 0;
2017-10-20 03:51:08 +08:00
overflow: hidden;
text-overflow: ellipsis;
2018-11-13 01:21:54 +08:00
flex: 1 1 0%;
}
.d-icon + .name,
.svg-icon-title + .name {
margin-left: 0.5em;
}
&.is-highlighted {
background: $tertiary-low;
}
&.is-selected {
background: $highlight-medium;
}
&.is-selected.is-highlighted {
background: $tertiary-low;
}
.discourse-tag,
.discourse-tag-count {
color: $primary;
}
&.create-color-row {
border-left-style: solid;
border-left-width: 5px;
}
}
.select-kit-collection {
background: $secondary;
overflow-x: hidden;
overflow-y: auto;
border-radius: inherit;
-webkit-overflow-scrolling: touch;
2017-10-20 03:51:08 +08:00
margin: 0;
padding: 0;
max-height: 250px;
width: 100%;
.validation-message {
white-space: nowrap;
color: $danger;
flex: 1 0 auto;
margin: 5px;
padding: 0 2px;
}
.select-kit-collection {
padding: 0;
margin: 0;
&:hover .select-kit-row.is-highlighted:hover {
background: $tertiary-low;
}
}
&::-webkit-scrollbar {
-webkit-appearance: none;
width: 10px;
}
&::-webkit-scrollbar-thumb {
cursor: pointer;
border-radius: 5px;
background: $primary-med-or-secondary-med;
}
&::-webkit-scrollbar-track {
background: transparent;
border-radius: 0;
}
}
.select-kit-filter {
box-sizing: border-box;
align-items: center;
justify-content: space-between;
width: 100%;
.filter-input {
background: none;
margin: 0;
2017-10-20 03:51:08 +08:00
padding: 0;
flex: 1 0 0px;
outline: none;
border: 0;
2017-10-20 03:51:08 +08:00
border-radius: 0;
box-shadow: none;
width: auto;
2017-10-20 03:51:08 +08:00
}
&.is-hidden {
width: 1px;
height: 1px;
border: 0;
margin: -1px;
2017-10-20 03:51:08 +08:00
padding: 0;
overflow: hidden;
position: fixed;
outline: 0;
left: 0;
top: 0;
}
}
.select-kit-wrapper {
position: absolute;
top: 0;
left: 0;
background: none;
display: none;
box-sizing: border-box;
pointer-events: none;
}
.select-kit-errors-collection {
background: $danger;
padding: 0.25em 1em;
margin: 0;
width: 100%;
box-sizing: border-box;
.select-kit-error {
list-style: none;
color: $secondary;
}
}
.no-content,
.is-loading {
display: flex;
flex: 1 0 auto;
padding: 0.5em;
width: 100%;
box-sizing: border-box;
background: $secondary;
}
.is-loading {
align-items: center;
justify-content: center;
}
}