In most cases using a selector would probably work, but there are some that will select other elements in different screens.
e.g. I changed the color for the “warning” in the attachment screen:
This is what happens, when you open preferences:
Therefore a ui-warning
class is the only way to change this without side-effects. This class should also be used for Preferences -> Encryption -> E2EE text
and Banner
(see first 2 items in above list).
I understand that there are more important issues to fix right now, so I am just mentioning this for future reference.