Select Option Theming Support
Added support for customizing select option colors through the theme system. This allows for more granular control over the appearance of select options in different states.
Usage
You can now customize select option colors using the following theme structure:
const updatedTheme = window.hapiUtils.mergeDeepOverwriteArrays(
window.hapi.theming.state.theme.value,
{
selectOption: {
color: "green",
background: "white",
"&:hover": {
color: "blue",
background: "lightblue",
},
"&.selected": {
color: "white",
background: "darkgreen",
},
},
},
)
window.hapi.theming.state.theme = updatedTheme
Theme Properties
The following properties are available for customization:
selectOption.color
: Controls the default text colorselectOption.background
: Controls the default background colorselectOption["&:hover"].color
: Controls the text color on hoverselectOption["&:hover"].background
: Controls the background color on hoverselectOption["&.selected"].color
: Controls the text color when an option is selectedselectOption["&.selected"].background
: Controls the background color when an option is selected
If any of these properties are not specified, the component will fall back to the default theme colors.