MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

Theme brush rename

Open Keboo opened this issue 3 years ago • 5 comments

Right now there is not a good standardization of brush name, or how to add new brushes to the theme. These have also deviated from the latest material design guidance.

The plan is to introduce the new brush names alongside the current brushes; however the old brushes names should be considered obsolete with the intention to remove them in the 5.x release.

This issue is a request for comment on the design moving forward.

Brush naming rules:

  1. Brush names will be prefixed with "MaterialDesign.Brush."
  2. Foreground brushes will be named with their corresponding brush with ".Foreground" suffix appended
  3. Color resources will be named with their corresponding brush with ".Color" suffix appended
  4. "Mid" or default colors will have "mid" removed from their names for brevity
  5. Brushes used by controls should be prefixed with "MaterialDesign.Brush.<ControlName>.<BrushName>"

This will greatly expand the total number of brushes, however with the use of extension methods on ITheme many of these should not need to be set directly unless greater customization is desired.

Feedback?

Here is the current set of theme brushes as well as some of the proposed new names: PrimaryHueLightBrush => MaterialDesign.Brush.Primary.Light PrimaryHueLightForegroundBrush => MaterialDesign.Brush.Primary.Light.Foreground PrimaryHueMidBrush => MaterialDesign.Brush.Primary PrimaryHueMidForegroundBrush => MaterialDesign.Brush.Primary.Foreground PrimaryHueDarkBrush => MaterialDesign.Brush.Primary.Dark PrimaryHueDarkForegroundBrush => MaterialDesign.Brush.Primary.Dark.Foreground SecondaryHueLightBrush => MaterialDesign.Brush.Secondary.Light SecondaryHueLightForegroundBrush => MaterialDesign.Brush.Secondary.Light.Foreground SecondaryHueMidBrush => MaterialDesign.Brush.Secondary SecondaryHueMidForegroundBrush => MaterialDesign.Brush.Secondary.Foreground SecondaryHueDarkBrush => MaterialDesign.Brush.Secondary.Dark SecondaryHueDarkForegroundBrush => MaterialDesign.Brush.Secondary.Dark.Foreground MaterialDesignValidationErrorBrush => MaterialDesign.Brush.<ControlName>.ValidationError MaterialDesignBackground => (removed; use MaterialDesign.Brush.Background) MaterialDesignPaper => MaterialDesign.Brush.Background MaterialDesignCardBackground => MaterialDesign.Brush.Card.Background MaterialDesignToolBarBackground => MaterialDesign.Brush.ToolBar.Background MaterialDesignBody => MaterialDesign.Brush.Text.Foreground MaterialDesignBodyLight => MaterialDesign.Brush.Text.Light.Foreground MaterialDesignColumnHeader => MaterialDesign.Brush.DataGrid.ColumnHeaderForeground and MaterialDesign.Brush.ListView.GridViewColumnHeaderForeground MaterialDesignCheckBoxOff => MaterialDesign.Brush.CheckBox.CheckOff MaterialDesignCheckBoxDisabled => MaterialDesign.Brush.CheckBox.CheckDisabled MaterialDesignTextBoxBorder => (this brush will need to be multiplied for all controls) MaterialDesign.Brush.TextBox.Border MaterialDesignDivider => (replaced with control specific brushes) MaterialDesignSelection => (replaced with control specific brushes) MaterialDesignToolForeground => (replaced with control specific brushes) MaterialDesignToolBackground => (replaced with control specific brushes) MaterialDesignFlatButtonClick => MaterialDesign.Brush.ToolBar.Button.MouseOver MaterialDesignFlatButtonRipple => MaterialDesign.Brush.<Control>.RippleFeedback MaterialDesignToolTipBackground => MaterialDesign.Brush.ToolTip.Background MaterialDesignChipBackground => MaterialDesign.Brush.Chip.Background MaterialDesignSnackbarBackground => MaterialDesign.Brush.Snackbar.Background MaterialDesignSnackbarMouseOver => MaterialDesign.Brush.Snackbar.MouseOver MaterialDesignSnackbarRipple => MaterialDesign.Brush.Snackbar.RippleFeedback MaterialDesignTextFieldBoxBackground => (replaced with control specific brushes) MaterialDesignTextFieldBoxHoverBackground => (replaced with control specific brushes) MaterialDesignTextFieldBoxDisabledBackground => (replaced with control specific brushes) MaterialDesignTextAreaBorder => (replaced with control specific brushes) MaterialDesignTextAreaInactiveBorder => (replaced with control specific brushes) MaterialDesignDataGridRowHoverBackground => (replaced with control specific brushes)

Keboo avatar Sep 24 '21 04:09 Keboo

Total renaming of the brushes? I like it, no problems. But before update old versions to newer (v4.3 or v5.0), we are should be aware about it. Thanks. Some of my projects still using v3.

Erapchu avatar Sep 25 '21 10:09 Erapchu

I'm all for progress even with breaking changes. Bring it :)

bebenins avatar Sep 25 '21 11:09 bebenins

@Erapchu yea that plan is to start the rename soon but leave both brush names in place for the new few version to give people time to update.

Keboo avatar Sep 25 '21 17:09 Keboo

I really like the unification of the resources name header. A welcome change nonetheless.

kacciocciacciara avatar Sep 30 '21 12:09 kacciocciacciara

Looks good. Really like the consistency in naming!

What I also like is that more colors are added. Yesterday I looked for the brushes of the Chip its delete button (to use in a control next to it) and then sadly found out that they were hard coded inside of the Chip style.

JorisCleVR avatar Oct 08 '21 07:10 JorisCleVR