-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
MarkdownTextBlock.xaml
108 lines (105 loc) · 7.09 KB
/
MarkdownTextBlock.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default" />
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FFBEBEBE" />
<SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FFF6F8FA" />
<SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FFDDDFE1" />
<SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FF6E6F70" />
<SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FF6E747C" />
<SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FFF6F8FA" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" />
<SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" />
<SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" />
<SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" />
<SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" />
<SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="#FF202020" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<SolidColorBrush x:Key="MarkdownBorderBrush" Color="#FF424242" />
<SolidColorBrush x:Key="MarkdownBackgroundBrush" Color="#FF202020" />
<SolidColorBrush x:Key="MarkdownInlineCodeBackgroundBrush" Color="#FF363636" />
<SolidColorBrush x:Key="MarkdownInlineCodeForegroundBrush" Color="#FFB7B4B4" />
<SolidColorBrush x:Key="MarkdownQuoteForeground" Color="#FFBEC1C5" />
<SolidColorBrush x:Key="MarkdownRichTextBlockBackground" Color="{ThemeResource SystemColorWindowColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<Style TargetType="controls:MarkdownTextBlock">
<Setter Property="Background" Value="{ThemeResource MarkdownRichTextBlockBackground}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="LinkForeground" Value="{ThemeResource SystemColorHotlightColor}" />
<Setter Property="QuoteBackground" Value="Transparent" />
<Setter Property="QuoteForeground" Value="{ThemeResource MarkdownQuoteForeground}" />
<Setter Property="QuoteBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="QuoteBorderThickness" Value="2, 0, 0, 0" />
<Setter Property="QuoteMargin" Value="7, 5, 0, 5" />
<Setter Property="QuotePadding" Value="7, 2, 0, 4" />
<Setter Property="CodeBackground" Value="{ThemeResource MarkdownBackgroundBrush}" />
<Setter Property="CodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="CodeBorderThickness" Value="0" />
<Setter Property="CodeFontFamily" Value="Consolas" />
<Setter Property="CodeMargin" Value="0, 7, 0, 7" />
<Setter Property="CodePadding" Value="10, 6, 10, 6" />
<Setter Property="InlineCodeBorderThickness" Value="0" />
<Setter Property="InlineCodePadding" Value="4, 2, 4, 2" />
<Setter Property="InlineCodeMargin" Value="2,0,2,-4"/>
<Setter Property="InlineCodeBackground" Value="{ThemeResource MarkdownInlineCodeBackgroundBrush}" />
<Setter Property="InlineCodeBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="InlineCodeForeground" Value="{ThemeResource MarkdownInlineCodeForegroundBrush}" />
<Setter Property="InlineCodeFontFamily" Value="Consolas" />
<Setter Property="EmojiFontFamily" Value="Segoe UI Emoji" />
<Setter Property="Header1FontWeight" Value="Bold" />
<Setter Property="Header1FontSize" Value="20" />
<Setter Property="Header1Margin" Value="0, 15, 0, 15" />
<Setter Property="Header1Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="Header2FontWeight" Value="Normal" />
<Setter Property="Header2FontSize" Value="20" />
<Setter Property="Header2Margin" Value="0, 15, 0, 15" />
<Setter Property="Header2Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="Header3FontWeight" Value="Bold" />
<Setter Property="Header3FontSize" Value="17" />
<Setter Property="Header3Margin" Value="0, 10, 0, 10" />
<Setter Property="Header3Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="Header4FontWeight" Value="Normal" />
<Setter Property="Header4FontSize" Value="17" />
<Setter Property="Header4Margin" Value="0, 10, 0, 10" />
<Setter Property="Header4Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="Header5FontWeight" Value="Bold" />
<Setter Property="Header5FontSize" Value="15" />
<Setter Property="Header5Margin" Value="0, 10, 0, 5" />
<Setter Property="Header5Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="Header6FontWeight" Value="Normal" />
<Setter Property="Header6FontSize" Value="15" />
<Setter Property="Header6Margin" Value="0, 10, 0, 0" />
<Setter Property="Header6Foreground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
<Setter Property="HorizontalRuleBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="HorizontalRuleMargin" Value="0, 7, 0, 7" />
<Setter Property="HorizontalRuleThickness" Value="2" />
<Setter Property="ListMargin" Value="0, 5, 0, 5" />
<Setter Property="ListGutterWidth" Value="32" />
<Setter Property="ListBulletSpacing" Value="8" />
<Setter Property="ParagraphMargin" Value="0, 5, 0, 5" />
<Setter Property="ParagraphLineHeight" Value="20" />
<Setter Property="TableBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="TableBorderThickness" Value="1" />
<Setter Property="TableCellPadding" Value="9, 4, 9, 4" />
<Setter Property="YamlBorderThickness" Value="1" />
<Setter Property="YamlBorderBrush" Value="{ThemeResource MarkdownBorderBrush}" />
<Setter Property="TableMargin" Value="0, 5, 0, 5" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:MarkdownTextBlock">
<Border x:Name="RootElement"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>