Skip to content

Commit

Permalink
fix: Add missing material text styles
Browse files Browse the repository at this point in the history
  • Loading branch information
kazo0 committed Jun 1, 2022
1 parent 5d71ab4 commit a95b492
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/library/Uno.Material/MaterialResourcesV2.cs
Expand Up @@ -75,6 +75,9 @@ private IEnumerable<(string ResourceKey, string SharedKey, bool IsDefaultStyle)>
Add("MaterialBodySmall");
Add("MaterialCalendarDatePickerStyle", isImplicit: true);
Add("MaterialCalendarViewStyle", isImplicit: true);
Add("MaterialCaptionLarge");
Add("MaterialCaptionMedium");
Add("MaterialCaptionSmall");
Add("MaterialCheckBoxStyle", isImplicit: true);
Add("MaterialComboBoxStyle", isImplicit: true);
Add("MaterialCommandBarStyle", isImplicit: true);
Expand All @@ -96,6 +99,7 @@ private IEnumerable<(string ResourceKey, string SharedKey, bool IsDefaultStyle)>
Add("MaterialHyperlinkButtonStyle", isImplicit: true);
Add("MaterialIconButtonStyle");
Add("MaterialIconToggleButtonStyle");
Add("MaterialLabelExtraSmall");
Add("MaterialLabelLarge");
Add("MaterialLabelMedium");
Add("MaterialLabelSmall");
Expand Down
70 changes: 69 additions & 1 deletion src/library/Uno.Material/Styles/Controls/v2/TextBlock.xaml
Expand Up @@ -188,7 +188,21 @@
Value="45.454" />
</Style>

<!-- Body Large -->
<!-- Label ExtraSmall -->
<Style x:Key="MaterialLabelExtraSmall"
BasedOn="{StaticResource MaterialBaseTextBlockStyle}"
TargetType="TextBlock">

<Setter Property="FontSize"
Value="11" />
<Setter Property="LineHeight"
Value="16" />
<!-- Tracking: 0.1 px -->
<Setter Property="CharacterSpacing"
Value="7.143" />
</Style>

<!-- Body Large -->
<Style x:Key="MaterialBodyLarge"
BasedOn="{StaticResource MaterialBaseTextBlockStyle}"
TargetType="TextBlock">
Expand Down Expand Up @@ -235,4 +249,58 @@
<Setter Property="CharacterSpacing"
Value="33.333" />
</Style>

<!-- Caption Large -->
<Style x:Key="MaterialCaptionLarge"
BasedOn="{StaticResource MaterialBaseTextBlockStyle}"
TargetType="TextBlock">

<Setter Property="FontSize"
Value="13" />
<Setter Property="LineHeight"
Value="18" />
<Setter Property="FontWeight"
Value="Medium" />
<Setter Property="FontFamily"
Value="{StaticResource MaterialMediumFontFamily}" />
<!-- Tracking: 0.15 px -->
<Setter Property="CharacterSpacing"
Value="9.375" />
</Style>

<!-- Caption Medium -->
<Style x:Key="MaterialCaptionMedium"
BasedOn="{StaticResource MaterialBaseTextBlockStyle}"
TargetType="TextBlock">

<Setter Property="FontSize"
Value="12" />
<Setter Property="LineHeight"
Value="16" />
<Setter Property="FontWeight"
Value="Medium" />
<Setter Property="FontFamily"
Value="{StaticResource MaterialMediumFontFamily}" />
<!-- Tracking: 0.4 px -->
<Setter Property="CharacterSpacing"
Value="33.333" />
</Style>

<!-- Caption Small -->
<Style x:Key="MaterialCaptionSmall"
BasedOn="{StaticResource MaterialBaseTextBlockStyle}"
TargetType="TextBlock">

<Setter Property="FontSize"
Value="11" />
<Setter Property="LineHeight"
Value="13" />
<Setter Property="FontWeight"
Value="Medium" />
<Setter Property="FontFamily"
Value="{StaticResource MaterialMediumFontFamily}" />
<!-- Tracking: 0.1 px -->
<Setter Property="CharacterSpacing"
Value="7.143" />
</Style>
</ResourceDictionary>
Expand Up @@ -198,6 +198,14 @@
Style="{StaticResource LabelSmall}" />
</smtx:XamlDisplay>


<!-- Label ExtraSmall -->
<smtx:XamlDisplay UniqueKey="M3Material_TextBlockSamplePage_LabelExtraSmall"
Style="{StaticResource XamlDisplayBelowStyle}">
<TextBlock Text="Label ExtraSmall"
Style="{StaticResource LabelExtraSmall}" />
</smtx:XamlDisplay>

<!-- Body Large -->
<smtx:XamlDisplay UniqueKey="M3Material_TextBlockSamplePage_BodyLarge"
Style="{StaticResource XamlDisplayBelowStyle}">
Expand All @@ -218,6 +226,27 @@
<TextBlock Text="Body Small - Lorem ipsum dolor sit amet consectetur adipiscing, elit aliquam ullamcorper commodo primis ornare"
Style="{StaticResource BodySmall}" />
</smtx:XamlDisplay>

<!-- Caption Large -->
<smtx:XamlDisplay UniqueKey="M3Material_TextBlockSamplePage_CaptionLarge"
Style="{StaticResource XamlDisplayBelowStyle}">
<TextBlock Text="Caption Large - Lorem ipsum dolor sit amet consectetur adipiscing, elit aliquam ullamcorper commodo primis ornare"
Style="{StaticResource CaptionLarge}" />
</smtx:XamlDisplay>

<!-- Caption Medium -->
<smtx:XamlDisplay UniqueKey="M3Material_TextBlockSamplePage_CaptionMedium"
Style="{StaticResource XamlDisplayBelowStyle}">
<TextBlock Text="Caption Medium - Lorem ipsum dolor sit amet consectetur adipiscing, elit aliquam ullamcorper commodo primis ornare"
Style="{StaticResource CaptionMedium}" />
</smtx:XamlDisplay>

<!-- Caption Small -->
<smtx:XamlDisplay UniqueKey="M3Material_TextBlockSamplePage_CaptionSmall"
Style="{StaticResource XamlDisplayBelowStyle}">
<TextBlock Text="Caption Small - Lorem ipsum dolor sit amet consectetur adipiscing, elit aliquam ullamcorper commodo primis ornare"
Style="{StaticResource CaptionSmall}" />
</smtx:XamlDisplay>
</StackPanel>
</DataTemplate>
</sample:SamplePageLayout.M3MaterialTemplate>
Expand Down

0 comments on commit a95b492

Please sign in to comment.