unoplatform / Uno.Themes

This library is designed to help you use the Material, Fluent or Cupertino design system with the Uno Platform
https://platform.uno
Apache License 2.0
170 stars 32 forks source link

[Material] Add support for tone-based surface colors #1442

Open kazo0 opened 4 months ago

kazo0 commented 4 months ago

Given the deprecation of the surface tint color system and the removal of the SurfaceTint extensions, we need a way to enable the dynamic color roles for the surface-based brushes in Material.

The new way for dealing with tonal color roles for Surface is outlined in this documentation.

We need to find a way to handle the dynamic generation of these color roles for the Brushes that are based on SurfaceColor.

While we're at it, we should also look into the Bright/Dim Surface Color (Might need to be a separate issue. Mentioning here as maybe the implementation will be affected)

kazo0 commented 4 months ago

I'm thinking we will need to dynamically create and inject some SolidColorBrush resources during the init process of MateialTheme. So we can read the values for SurfaceColor that is provided, or overridden, and then generate some Surface[Container][Lowest][Low][etc.]Brush resources

mikernet commented 4 months ago

The colors for the tonal surface roles are already in the material theme json export from the material theme builder, the Dsp tool just doesn't map them to colors and brushes:

      "surfaceDim": "#E8D6D4",
      "surfaceBright": "#FFF8F7",
      "surfaceContainerLowest": "#FFFFFF",
      "surfaceContainerLow": "#FFF0EE",
      "surfaceContainer": "#FCEAE7",
      "surfaceContainerHigh": "#F6E4E2",
      "surfaceContainerHighest": "#F1DEDC"