Skip to content

Commit

Permalink
fix: Fixes Material Card themed backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
lesterbotello committed May 26, 2023
1 parent cccd79f commit 5ee5440
Showing 1 changed file with 51 additions and 27 deletions.
78 changes: 51 additions & 27 deletions src/library/Uno.Toolkit.Material/Styles/Controls/v2/Card.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,48 @@
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:um="using:Uno.Material"
xmlns:toolkit="using:Uno.UI.Toolkit">

<!-- Card Brushes Resources -->
<!-- Elevated -->
<StaticResource x:Key="MaterialElevatedCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Filled -->
<StaticResource x:Key="MaterialFilledCardBackground"
ResourceKey="SurfaceVariantBrush" />

<!-- Outlined -->
<StaticResource x:Key="MaterialOutlinedCardBackground"
ResourceKey="SurfaceBrush" />
<StaticResource x:Key="MaterialOutlinedCardBorderBrush"
ResourceKey="OutlineBrush" />

<!-- Card Other Resources -->
<!-- Double -->
<ResourceDictionary.ThemeDictionaries>
<!-- Card Brushes Theme Resources -->
<ResourceDictionary x:Key="Default">
<!-- Filled -->
<StaticResource x:Key="MaterialFilledCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Outlined -->
<StaticResource x:Key="MaterialOutlinedCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Elevated -->
<StaticResource x:Key="MaterialElevatedCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Card Other Resources -->
<StaticResource x:Key="MaterialOutlinedCardBorderBrush"
ResourceKey="OutlineBrush" />
</ResourceDictionary>

<ResourceDictionary x:Key="Light">
<!-- Filled -->
<StaticResource x:Key="MaterialFilledCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Outlined -->
<StaticResource x:Key="MaterialOutlinedCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Elevated -->
<StaticResource x:Key="MaterialElevatedCardBackground"
ResourceKey="SurfaceBrush" />

<!-- Card Other Resources -->
<StaticResource x:Key="MaterialOutlinedCardBorderBrush"
ResourceKey="OutlineBrush" />
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast" />
</ResourceDictionary.ThemeDictionaries>

<!-- Double -->
<x:Double x:Key="MaterialCardMinHeight">72</x:Double>
<x:Double x:Key="MaterialCardMaxWidth">344</x:Double>

Expand Down Expand Up @@ -154,7 +178,7 @@
TargetType="utu:Card"
BasedOn="{StaticResource MaterialBaseCardStyle}">
<Setter Property="Background"
Value="{StaticResource MaterialFilledCardBackground}" />
Value="{ThemeResource MaterialFilledCardBackground}" />
<Setter Property="VerticalAlignment"
Value="Stretch" />
<Setter Property="VerticalContentAlignment"
Expand Down Expand Up @@ -337,7 +361,7 @@
BasedOn="{StaticResource MaterialFilledCardStyle}">

<Setter Property="Background"
Value="{StaticResource MaterialOutlinedCardBackground}" />
Value="{ThemeResource MaterialOutlinedCardBackground}" />
<Setter Property="BorderBrush"
Value="{ThemeResource MaterialOutlinedCardBorderBrush}" />
<Setter Property="BorderThickness"
Expand All @@ -348,7 +372,7 @@
BasedOn="{StaticResource MaterialBaseCardStyle}"
TargetType="utu:Card">
<Setter Property="Background"
Value="{StaticResource MaterialElevatedCardBackground}" />
Value="{ThemeResource MaterialElevatedCardBackground}" />
<Setter Property="VerticalAlignment"
Value="Stretch" />
<Setter Property="VerticalContentAlignment"
Expand Down Expand Up @@ -534,7 +558,7 @@
TargetType="utu:Card">

<Setter Property="Background"
Value="{StaticResource MaterialFilledCardBackground}" />
Value="{ThemeResource MaterialFilledCardBackground}" />

<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -733,7 +757,7 @@
TargetType="utu:Card">

<Setter Property="Background"
Value="{StaticResource MaterialOutlinedCardBackground}" />
Value="{ThemeResource MaterialOutlinedCardBackground}" />
<Setter Property="BorderBrush"
Value="{ThemeResource MaterialOutlinedCardBorderBrush}" />
<Setter Property="BorderThickness"
Expand All @@ -745,7 +769,7 @@
TargetType="utu:Card">

<Setter Property="Background"
Value="{StaticResource MaterialElevatedCardBackground}" />
Value="{ThemeResource MaterialElevatedCardBackground}" />
<Setter Property="Elevation"
Value="{StaticResource MaterialCardElevation}" />

Expand Down Expand Up @@ -949,7 +973,7 @@
TargetType="utu:Card">

<Setter Property="Background"
Value="{StaticResource MaterialFilledCardBackground}" />
Value="{ThemeResource MaterialFilledCardBackground}" />

<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -1137,7 +1161,7 @@
<Setter Property="Padding"
Value="0" />
<Setter Property="Background"
Value="{StaticResource MaterialOutlinedCardBackground}" />
Value="{ThemeResource MaterialOutlinedCardBackground}" />
<Setter Property="BorderBrush"
Value="{ThemeResource MaterialOutlinedCardBorderBrush}" />
<Setter Property="BorderThickness"
Expand All @@ -1149,7 +1173,7 @@
TargetType="utu:Card">

<Setter Property="Background"
Value="{StaticResource MaterialElevatedCardBackground}" />
Value="{ThemeResource MaterialElevatedCardBackground}" />
<Setter Property="Elevation"
Value="{StaticResource MaterialCardElevation}" />

Expand Down

0 comments on commit 5ee5440

Please sign in to comment.