-
-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
background color ignored by sub box label widget #767
Comments
Agreed this is a little unexpected. I can certainly explain it - but that explanation is more of a rationalization than a satisfying API. The underlying problem here is that styles don't currently cascade (or, more specifically, there's no concept of "inherit" as a value in Pack). Broadly, we should be aiming to follow the lead of HTML and CSS here; so the YYY block should be inheriting it's color from it's parent. In this case, it's, not because it's getting the default background color. |
Doing some housekeeping; it occurs to me that one simple fix here might be to make the default background color for box transparent/no fill - that way, a child box will inherit the parent color by virtue of being transparent. |
Only some properties are inherited in CSS, and background-color isn't one of them. However, CSS's default background-color is indeed transparent. So I think that's a better solution. |
If I set a box with a background color, label widget children of that box are displayed correctly with the specified background.
However, if a child is another box that contains a label, then the background colour of the outer box is not propagated to the inner boxes.
Is that the expected behaviour?
I would have thought the I could set a background colour of a box and then all sub-widgets (no matter how deep in sub-boxes) would also be rendered with the same background colour.
Note how label "YYY" does not have the specified background colour. It has the default system colour.
The text was updated successfully, but these errors were encountered: