Support for WP's built-in color themes for select2 elements

This commit is contained in:
Viszt Péter 2019-11-16 13:19:00 +01:00 committed by Peter Fabian
parent 6d5d238062
commit 11e13425dd
1 changed files with 50 additions and 0 deletions

View File

@ -6699,6 +6699,56 @@ table.bar_chart {
}
}
/**
* Select2 colors for built-in admin color themes.
*/
.admin-color {
$wp_admin_colors: (
blue: #096484,
coffee: #c7a589,
ectoplasm: #a3b745,
midnight: #e14d43,
ocean: #9ebaa0,
sunrise: #dd823b,
light: #04a4cc
);
@each $name, $color in $wp_admin_colors {
&-#{$name} {
.select2-dropdown {
border-color: $color;
}
.select2-dropdown--below {
box-shadow: 0 0 0 1px $color, 0 2px 1px rgba(0, 0, 0, 0.1);
}
.select2-dropdown--above {
box-shadow: 0 0 0 1px $color, 0 -2px 1px rgba(0, 0, 0, 0.1);
}
.select2-selection--single .select2-selection__rendered:hover {
color: $color;
}
.select2-container.select2-container--focus .select2-selection--single,
.select2-container.select2-container--open .select2-selection--single,
.select2-container.select2-container--open .select2-selection--multiple {
border-color: $color;
box-shadow: 0 0 0 1px $color;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
background-color: $color;
}
}
}
}
.post-type-product .tablenav,
.post-type-shop_order .tablenav {