Fix select inputs when dark mode is enabled in Twenty Twenty-One (https://github.com/woocommerce/woocommerce-blocks/pull/3554)

* Add CSS rules for dark mode theme setting in Twenty Twenty-One

This is required because the theme may be set to dark mode independently of the browser. The reason we need two rules for this is because the checkout block can be set to have dark mode inputs too, so this rule doesn't need to apply then.

* Add theme-specific class for Twenty Twenty-One
This commit is contained in:
Thomas Roberts 2020-12-16 16:01:46 +00:00 committed by GitHub
parent 0e12c88bf2
commit ef081ef8a2
1 changed files with 16 additions and 0 deletions

View File

@ -118,3 +118,19 @@
display: none;
}
}
.theme-twentytwentyone {
&.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;
}
}
}