Skip to content
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

fix: Fixes Material Card themed backgrounds #582

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 49 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,46 @@
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.ThemeDictionaries>

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

Expand Down Expand Up @@ -154,7 +176,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 +359,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 +370,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 +556,7 @@
TargetType="utu:Card">

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

<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -733,7 +755,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 +767,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 +971,7 @@
TargetType="utu:Card">

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

<Setter Property="Template">
<Setter.Value>
Expand Down Expand Up @@ -1137,7 +1159,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 +1171,7 @@
TargetType="utu:Card">

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

Expand Down
Loading