DropdownField Hover Background Color Struggling to Override

Hello, I have a DropdownField and when I hover over it, the background colour turns to the default light grey colour. I’ve been trying to change the colour of this by overwriting whatever selector controls this colour.

The UI debugger tells me that the VisualElement attached to the DropdownField is where the colour is being changed.

This VisualElement shows 3 selectors: .unity-base-field__input, .unity-base-popup-field__input and unity-popup-field__input

.unity-base-popup-field__input is the one that has the initial unhovered background colour, so I successfully overwrote that to change the colour. But this still leaves the colour changing on hover.

I assumed that .unity-base-popup-field__input:hover would be what I needed to overwrite next but the colour still changes to light grey. So I tried overwriting the other selectors:hover to no success. I even tried the same with all the selectors shown on the DropdownField.

I can select the VisualElement in the debugger and watch the background colour switch to light grey as I hover over it. It tells me its from “unity stylesheet”. I’ve overwritten all matching selectors shown. I have no clue what I need to overwrite to get the drop down field to not turn light grey when hovering over it.

I’ve searched for similar questions and I’ve made sure to add my stylesheets to the theme style sheet, although that only really helped with the drop down list you get when you click it.

I was also able to successfully overwrite the unity-button hover thanks to the help here: .unity-button:hover backgorund color is ignored in theme style sheets but just like the user described there I don’t see any update of the matching pseudo selectors when hovering over things. I tried this in both 6000.0.2f1 and 2022.3.44f1

Well through trial and error I found that DropdownField:hover .unity-base-field__input.unity-base-popup-field__input.unity-popup-field__input works.

I guess its the DropdownField which has the hover pseudo class and you can see the state change with the debugger to be fair. Just doesn’t show all the matching selectors I guess.

I still don’t know exactly how I was supposed to know I needed to list all the other selectors if the debugger doesn’t update matching selectors with pseudo classes. But it’s probably just me being clueless.

EDIT - I guess I should mark this solved as it solves the title issue. I’d still like to know if there was a faster solution to this than trial and error though!