How to change a control's label color on 'focus'?

Using a slider control as an example (but issue is the same with others, like toggles), when you click on the slider itself, it changes the label color of the control to #00526A (checked the debugger). This unity docs page describes it as “The text color for a label when it has focus”.

Normally I could change any element of a control using classes or IDs, but with this one I cannot figure out how to access it and change it.

I tried every combination of classes and control IDs, and can’t seem modify the default focus color.

for example:
.my-slider .unity-base-slider__label:focus
Slider:focus .unity-base-slider__label
etc…

Is it not possible to change the focus color of the label when clicking on the control itself?

Any help would be greatly appreciated.

Quick edit: It seems as though it’s only the color that can’t change. Using this uss statement: “.my-slider:focus .unity-base-slider__label” , if I change the font size it changes on click, but the color doesn’t change.

If you open the UI Debugger (right click window) you can select the element and see what classes it has and the styles being applied. You can then see what style to override.

It’s been a while, but still no fix.

Here’s the issue visualized:

unity-checkbox-issue

Please file a bug report Unity QA: Building quality with passion