UITK does not respect color inheritance at all on text elements

Bypassing and ignoring Default.uss in it’s entirety (because color inheritance is impossible with it for text elements).

First I will point out the following:

  • in HTML/CSS, a div below body will inherit colors from body or it’s parent element unless styled.
  • this is one the the most trivial things in HTML/CSS, but a nightmare in UITK.
  • In UITK Documentation it is explicitly mentioned that Color is inherited.
  • Color keywords on non-text elements are useless if a text element does not inherit color from it’s parent container.

In a custom TSS I have elected to avoid Default.USS. Text element classes are a recurring issue with overrides.

Without a Default.USS, I have a new TSS with a stylesheet with the following rules:

* .unity-text-element
{
    color: inherited;
}

.aa-root
{
    /* there are labels nested below my .aa-root, I fully expect them to inherit THIS color*/
    color: red;
}

What the UIDebugger tells me, is that it recognizes the color should be inherited on text elements:
6915305--810959--upload_2021-3-9_4-38-32.png

The root container (.aa-root) has it’s color resolved correctly as well
6915305--810962--upload_2021-3-9_4-40-8.png
And it show on the resolved styles correctly for .aa-root itself:
6915305--810965--upload_2021-3-9_4-41-5.png

But any label nested below the root element does not inherit the parent’s color: only .aa-root defines a color currently.
Here is the heirarchy:
6915305--810968--upload_2021-3-9_4-42-36.png

How color is resolved on .unity-text elements (red is expected here). If this was HTML/XHTML/UML or any other HTML inspired UI toolkit this would be resolving to red. It isn`t even inheriting the default color from the PanelSettings root (#DefaultPanelSettings).
6915305--810971--upload_2021-3-9_4-44-38.png

So what is up with this whole inheritance thing? Is the documentation wrong?
It really doesn`t seem to work in any way whatsoever for text elements. Applying colors specifically to each type of .unity-text-element class directly defeats concept of inheritance in CSS or anything based on it.

Here is what you get when using default.uss and then trying to reset the style:

  • default.uss/UnityDefaultRuntimeTheme is often listed last in matching selectors for any text-element, a bad omen
  • deferring the addition of my own stylesheets by one second to force UITK to match selectors in the correct order for text elements, even then - inherited does not work on text color.

This is still a text element nested down the heirarchy of the same .aa-root above

Considering previous attempts to bug-report broken text-element styles resulting in a wont fix, are we going be stuck with this kind of annoyance forever?

And to further demonstrate my point: Popup is inheriting color from the .aa-root classed template container above it . But that isn`t a text element, so of course it will work there.