2020-07-10 09:09:49 +00:00
|
|
|
// 18px is the minimum input field line-height and 14px is the font-size of
|
|
|
|
// the drop down selector elements.
|
2021-08-24 11:37:43 +00:00
|
|
|
|
|
|
|
$dropdown-selector-line-height: math.div(18, 14);
|
2020-07-10 09:09:49 +00:00
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector {
|
2019-12-03 13:39:11 +00:00
|
|
|
max-width: 300px;
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__input-wrapper {
|
2020-07-10 09:09:49 +00:00
|
|
|
background: #fff;
|
|
|
|
border: 1px solid $input-border-gray;
|
|
|
|
color: $input-text-active;
|
2019-12-05 13:58:44 +00:00
|
|
|
align-items: center;
|
2019-12-03 13:39:11 +00:00
|
|
|
border-radius: 4px;
|
|
|
|
cursor: text;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2020-07-10 09:09:49 +00:00
|
|
|
padding: 2px $gap-smaller;
|
2019-12-03 13:39:11 +00:00
|
|
|
|
|
|
|
.is-disabled & {
|
2020-10-22 10:40:32 +00:00
|
|
|
background-color: $gray-200;
|
2019-12-03 13:39:11 +00:00
|
|
|
}
|
|
|
|
|
2020-07-10 09:09:49 +00:00
|
|
|
.is-multiple.has-checked > & {
|
|
|
|
padding: 2px $gap-smallest;
|
|
|
|
}
|
|
|
|
|
|
|
|
.is-open > & {
|
|
|
|
border-radius: 4px 4px 0 0;
|
|
|
|
}
|
2019-12-03 13:39:11 +00:00
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__input {
|
2020-06-01 04:45:40 +00:00
|
|
|
@include font-size(small);
|
2020-07-10 09:09:49 +00:00
|
|
|
line-height: $dropdown-selector-line-height;
|
2022-03-28 13:00:20 +00:00
|
|
|
margin: em($gap-small * 0.25) 0;
|
2019-12-03 13:39:11 +00:00
|
|
|
min-width: 0;
|
2020-07-10 09:09:49 +00:00
|
|
|
padding: em($gap-smallest * 0.75) 0 em($gap-smallest * 0.75);
|
2019-12-05 13:58:44 +00:00
|
|
|
|
|
|
|
.is-single & {
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
outline: 0;
|
|
|
|
}
|
2020-07-10 09:09:49 +00:00
|
|
|
}
|
2019-12-05 13:58:44 +00:00
|
|
|
|
2020-07-10 09:09:49 +00:00
|
|
|
.is-single.has-checked.is-open & {
|
|
|
|
margin-bottom: 1.5px;
|
|
|
|
margin-top: 1.5px;
|
|
|
|
}
|
2019-12-05 13:58:44 +00:00
|
|
|
|
2020-07-10 09:09:49 +00:00
|
|
|
.is-single.has-checked:not(.is-open) & {
|
|
|
|
@include visually-hidden();
|
|
|
|
// Fixes an issue in Firefox that `flex: wrap` in the container was making
|
|
|
|
// this element to still occupy one line.
|
|
|
|
position: absolute;
|
2019-12-05 13:58:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.is-multiple & {
|
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Visually hide the input
|
2020-06-17 09:53:42 +00:00
|
|
|
.is-single .wc-block-components-dropdown-selector__input:first-child,
|
|
|
|
.is-multiple .wc-block-components-dropdown-selector__input {
|
2019-12-05 13:58:44 +00:00
|
|
|
background: transparent;
|
|
|
|
border: 0;
|
2019-12-03 13:39:11 +00:00
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector {
|
2019-12-05 13:58:44 +00:00
|
|
|
// Reset <button> styles
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__selected-value__label,
|
|
|
|
.wc-block-components-dropdown-selector__selected-value__remove {
|
2019-12-05 13:58:44 +00:00
|
|
|
background-color: transparent;
|
|
|
|
border: 0;
|
|
|
|
color: inherit;
|
|
|
|
font-size: inherit;
|
|
|
|
font-weight: inherit;
|
|
|
|
text-transform: initial;
|
2019-12-03 13:39:11 +00:00
|
|
|
|
2019-12-05 13:58:44 +00:00
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
background-color: transparent;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__selected-value {
|
2020-07-10 09:09:49 +00:00
|
|
|
@include font-size(small);
|
2019-12-05 13:58:44 +00:00
|
|
|
align-items: center;
|
2020-10-22 10:40:32 +00:00
|
|
|
color: $gray-700;
|
2019-12-05 13:58:44 +00:00
|
|
|
display: inline-flex;
|
2022-03-28 13:00:20 +00:00
|
|
|
margin: em($gap-small * 0.25) 0;
|
2020-07-10 09:09:49 +00:00
|
|
|
padding: em($gap-smallest * 0.75) 0 em($gap-smallest * 0.75);
|
2019-12-05 13:58:44 +00:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2020-07-10 09:09:49 +00:00
|
|
|
.wc-block-components-dropdown-selector__selected-value__label {
|
2019-12-05 13:58:44 +00:00
|
|
|
flex-grow: 1;
|
2020-07-10 09:09:49 +00:00
|
|
|
line-height: $dropdown-selector-line-height;
|
2019-12-05 13:58:44 +00:00
|
|
|
padding: 0;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
2020-07-10 09:09:49 +00:00
|
|
|
.wc-block-components-dropdown-selector__selected-value__remove {
|
2019-12-05 13:58:44 +00:00
|
|
|
background-color: transparent;
|
|
|
|
border: 0;
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 1;
|
2020-07-10 09:09:49 +00:00
|
|
|
padding: 0 0 0 0.3em;
|
|
|
|
|
2020-07-10 18:20:57 +00:00
|
|
|
> svg {
|
2020-07-10 09:09:49 +00:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.wc-block-components-dropdown-selector__selected-chip {
|
|
|
|
@include font-size(small);
|
2022-03-28 13:00:20 +00:00
|
|
|
margin-top: em($gap-small * 0.25);
|
|
|
|
margin-bottom: em($gap-small * 0.25);
|
2020-07-10 09:09:49 +00:00
|
|
|
line-height: $dropdown-selector-line-height;
|
2019-12-05 13:58:44 +00:00
|
|
|
}
|
2019-12-03 13:39:11 +00:00
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__list {
|
2020-05-14 09:07:21 +00:00
|
|
|
background-color: #fff;
|
2019-12-03 13:39:11 +00:00
|
|
|
margin: -1px 0 0;
|
2019-12-05 13:58:44 +00:00
|
|
|
padding: 0;
|
2019-12-03 13:39:11 +00:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 100%;
|
|
|
|
max-height: 300px;
|
|
|
|
overflow-y: auto;
|
|
|
|
z-index: 1;
|
|
|
|
|
|
|
|
&:not(:empty) {
|
|
|
|
border: 1px solid #9f9f9f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-dropdown-selector__list-item {
|
2020-06-01 04:45:40 +00:00
|
|
|
@include font-size(small);
|
2020-10-22 10:40:32 +00:00
|
|
|
color: $gray-700;
|
2019-12-05 13:58:44 +00:00
|
|
|
cursor: default;
|
2020-05-14 09:07:21 +00:00
|
|
|
list-style: none;
|
2019-12-05 13:58:44 +00:00
|
|
|
margin: 0;
|
2019-12-03 13:39:11 +00:00
|
|
|
padding: 0 $gap-smallest;
|
|
|
|
|
|
|
|
&.is-selected {
|
2020-10-22 10:40:32 +00:00
|
|
|
background-color: $gray-300;
|
2019-12-03 13:39:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&.is-highlighted,
|
|
|
|
&:active {
|
|
|
|
background-color: #00669e;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|