Brush Naming Conventions
See original GitHub issueIs your feature request related to a problem? Please describe.
Similar to #3584, the Background
and Foreground
properties for a number of controls are set to MahApps.Brushes.White
and MahApps.Brushes.Black
, respectively. As a user, I do not find this to be very intuitive (I expect them to stay white or black, not change depending on the theme).
Describe the solution you’d like
I suggest eliminating replacing the White
and Black
brushes with the following:
- White:
MahApps.Brushes.Window.Background
- Black:
MahApps.Brushes.Window.Foreground
I would also think that even eliminating the Foreground
brush would be ok, as this is usually set by another brush entirely (e.g. MahApps.Brushes.Accent
, MahApps.Brushes.Text
, or MahApps.Brushes.Label.Text
).
Related
Why is there a separate Brush
specifically for Label controls? Typically, all foreground colors are the same. If we were to have an alternate Brush
for different kinds of text (to give users some flexibility), I’d suggest
MahApps.Brushes.Text.Primary
MahApps.Brushes.Text.Secondary
We could even go down the Bootstrap methodology and provide a number of preset, overidable brushes (Bootstrap color documentation here):
MahApps.Brushes.Text.Primary
MahApps.Brushes.Text.Secondary
MahApps.Brushes.Text.Success
MahApps.Brushes.Text.Danger
MahApps.Brushes.Text.Warning
MahApps.Brushes.Text.Info
MahApps.Brushes.Text.Light
MahApps.Brushes.Text.Dark
MahApps.Brushes.Text.Body
MahApps.Brushes.Text.Muted
MahApps.Brushes.Text.White
MahApps.Brushes.Text.Black
We could then provide the same Brush
es for background use:
MahApps.Brushes.Background.Primary
MahApps.Brushes.Background.Secondary
MahApps.Brushes.Background.Success
MahApps.Brushes.Background.Danger
MahApps.Brushes.Background.Warning
MahApps.Brushes.Background.Info
MahApps.Brushes.Background.Light
MahApps.Brushes.Background.Dark
MahApps.Brushes.Background.White
MahApps.Brushes.Background.Black
MahApps.Brushes.Background.Transparent
Additional context https://getbootstrap.com/docs/4.3/utilities/colors/
Closed Issues
N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (6 by maintainers)
@amkuchta
I‘m working on it
If I have a look to this, there are many Brushes that use the same Color. And with
MahApps.Brushes.Black
andMahApps.Brushes.White
I am also with you @amkuchta , that this is a bit confiusing if you are new to the MahApps Theme.Maybe we should take the chance to reduce the amount of Brushes to a handful amount, with the option for the user to select another Brush in the Style of the control. But that would lead to a complete rewrite of all the Styles we have so far.
@ all: Let’s vote for this idea either with 👍 or 👎 @punker76 If you are with us, I would be happy to help with the rewriting of the Styles.
Happy coding, Tim