2020-06-17 09:53:42 +00:00
|
|
|
.wc-block-components-select {
|
2020-05-29 10:16:33 +00:00
|
|
|
height: 3em;
|
2020-01-17 16:58:08 +00:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
label {
|
2020-05-14 09:07:21 +00:00
|
|
|
@include reset-typography();
|
2020-05-29 10:16:33 +00:00
|
|
|
@include font-size(regular);
|
|
|
|
line-height: 1.375; // =22px when font-size is 16px.
|
2020-01-17 16:58:08 +00:00
|
|
|
position: absolute;
|
2020-04-30 10:18:12 +00:00
|
|
|
transform: translateY(0.75em);
|
2020-01-17 16:58:08 +00:00
|
|
|
transform-origin: top left;
|
|
|
|
transition: all 200ms ease;
|
2020-10-22 10:40:32 +00:00
|
|
|
color: $gray-700;
|
2020-01-17 16:58:08 +00:00
|
|
|
z-index: 1;
|
2020-05-20 13:54:37 +00:00
|
|
|
margin: 0 0 0 #{$gap + 1px};
|
2020-02-17 11:12:15 +00:00
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2020-05-20 13:54:37 +00:00
|
|
|
max-width: calc(100% - #{2 * $gap});
|
2020-04-14 11:43:10 +00:00
|
|
|
white-space: nowrap;
|
2020-01-17 16:58:08 +00:00
|
|
|
|
2020-08-14 11:08:16 +00:00
|
|
|
.has-dark-controls & {
|
|
|
|
color: $input-placeholder-dark;
|
|
|
|
}
|
2020-01-17 16:58:08 +00:00
|
|
|
@media screen and (prefers-reduced-motion: reduce) {
|
|
|
|
transition: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.is-active label {
|
2020-02-17 11:12:15 +00:00
|
|
|
transform: translateY(#{$gap-smallest}) scale(0.75);
|
2020-01-17 16:58:08 +00:00
|
|
|
}
|
|
|
|
|
2020-03-17 11:45:33 +00:00
|
|
|
&.has-error {
|
|
|
|
.components-custom-select-control__button {
|
2020-08-11 09:55:26 +00:00
|
|
|
&,
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
2020-10-22 10:40:32 +00:00
|
|
|
border-color: $alert-red;
|
2020-08-11 09:55:26 +00:00
|
|
|
}
|
|
|
|
&:focus {
|
2020-10-22 10:40:32 +00:00
|
|
|
outline: 1px dotted $alert-red;
|
2020-08-11 09:55:26 +00:00
|
|
|
outline-offset: 2px;
|
|
|
|
}
|
2020-03-17 11:45:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.has-error label {
|
2020-10-22 10:40:32 +00:00
|
|
|
color: $alert-red;
|
2020-03-17 11:45:33 +00:00
|
|
|
}
|
|
|
|
|
2020-01-17 16:58:08 +00:00
|
|
|
.components-custom-select-control__button {
|
2020-06-05 09:12:34 +00:00
|
|
|
&,
|
2020-01-17 16:58:08 +00:00
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
2020-06-05 09:12:34 +00:00
|
|
|
@include font-size(regular);
|
2021-02-17 12:40:52 +00:00
|
|
|
background: #fff;
|
2020-06-05 09:12:34 +00:00
|
|
|
box-shadow: none;
|
|
|
|
color: $input-text-active;
|
|
|
|
font-family: inherit;
|
|
|
|
font-weight: normal;
|
|
|
|
height: 3em;
|
|
|
|
letter-spacing: inherit;
|
|
|
|
line-height: 1;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: em($gap-large) $gap em($gap-smallest);
|
|
|
|
text-align: left;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
text-transform: none;
|
|
|
|
white-space: nowrap;
|
|
|
|
width: 100%;
|
2020-08-14 11:08:16 +00:00
|
|
|
.has-dark-controls & {
|
2021-02-17 12:40:52 +00:00
|
|
|
background: $input-background-dark;
|
2020-08-14 11:08:16 +00:00
|
|
|
border-color: $input-border-dark;
|
|
|
|
color: $input-text-dark;
|
|
|
|
}
|
2020-01-17 16:58:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-24 12:23:25 +00:00
|
|
|
.components-custom-select-control__button-icon {
|
|
|
|
right: #{$gap - 4px};
|
2020-08-14 11:08:16 +00:00
|
|
|
.has-dark-controls & {
|
|
|
|
fill: $input-text-dark;
|
|
|
|
}
|
2020-04-24 12:23:25 +00:00
|
|
|
}
|
|
|
|
|
2020-01-17 16:58:08 +00:00
|
|
|
.components-custom-select-control__menu {
|
2020-09-28 09:25:22 +00:00
|
|
|
background-color: $select-dropdown-light;
|
2020-01-17 16:58:08 +00:00
|
|
|
margin: 0;
|
|
|
|
max-height: 300px;
|
|
|
|
overflow: auto;
|
2021-01-12 09:09:47 +00:00
|
|
|
color: $input-text-active;
|
2020-04-24 12:23:25 +00:00
|
|
|
|
|
|
|
// Required by IE11.
|
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-08-14 11:08:16 +00:00
|
|
|
.has-dark-controls & {
|
|
|
|
background-color: $select-dropdown-dark;
|
|
|
|
color: $input-text-dark;
|
|
|
|
}
|
2020-01-17 16:58:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.components-custom-select-control__item {
|
2020-05-29 10:16:33 +00:00
|
|
|
@include font-size(regular);
|
2020-01-17 16:58:08 +00:00
|
|
|
margin-left: 0;
|
|
|
|
padding-left: $gap;
|
2020-08-14 11:08:16 +00:00
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&.is-highlighted {
|
|
|
|
.has-dark-controls & {
|
|
|
|
background-color: $select-item-dark;
|
|
|
|
}
|
|
|
|
}
|
2020-01-17 16:58:08 +00:00
|
|
|
}
|
2020-02-14 12:30:33 +00:00
|
|
|
|
|
|
|
.components-custom-select-control__item-icon {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-01-17 16:58:08 +00:00
|
|
|
}
|
2020-12-16 16:01:46 +00:00
|
|
|
|
|
|
|
.theme-twentytwentyone {
|
2021-02-09 08:10:45 +00:00
|
|
|
// Extra classes for specificity.
|
|
|
|
&.theme-twentytwentyone.theme-twentytwentyone .components-custom-select-control__button {
|
|
|
|
background-color: #fff;
|
|
|
|
color: $input-text-active;
|
|
|
|
}
|
|
|
|
|
2020-12-16 16:01:46 +00:00
|
|
|
&.is-dark-theme {
|
|
|
|
// If the theme is in dark mode, as well as the block, then this selector will match.
|
|
|
|
.has-dark-controls {
|
|
|
|
.components-custom-select-control__item {
|
|
|
|
color: $input-text-dark;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the theme is in dark mode, but the block isn't, then this selector will match.
|
|
|
|
.components-custom-select-control__item {
|
|
|
|
color: $input-text-active;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|