/
stylesheet.factor
156 lines (129 loc) · 3.62 KB
/
stylesheet.factor
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: assocs colors.constants fonts fry io.styles kernel literals
math namespaces sequences ui.theme ;
IN: help.stylesheet
: wrap-margin-full ( -- n )
42 default-font-size * ;
: wrap-margin-table-content ( -- n )
29 default-font-size * ;
: font-size-subsection ( -- n )
7/6 default-font-size * >integer ;
: font-size-title ( -- n )
5/3 default-font-size * >integer ;
: font-size-heading ( -- n )
4/3 default-font-size * >integer ;
: font-size-span ( -- n )
13/12 default-font-size * >integer ;
SYMBOL: default-span-style
H{
{ font-name $ default-sans-serif-font-name }
{ font-size $ font-size-span }
{ foreground $ text-color }
{ font-style plain }
} default-span-style set-global
SYMBOL: default-block-style
H{
{ wrap-margin $ wrap-margin-full }
} default-block-style set-global
SYMBOL: link-style
H{
{ foreground $ link-color }
{ font-style bold }
} link-style set-global
SYMBOL: emphasis-style
H{ { font-style italic } } emphasis-style set-global
SYMBOL: strong-style
H{ { font-style bold } } strong-style set-global
SYMBOL: title-style
H{
{ font-name $ default-sans-serif-font-name }
{ font-size $ font-size-title }
{ font-style bold }
{ wrap-margin $ wrap-margin-full }
{ foreground $ title-color }
{ page-color COLOR: FactorLightTan }
{ inset { 5 5 } }
} title-style set-global
SYMBOL: help-path-style
H{
{ font-size $ default-font-size }
{ table-gap { 5 5 } }
} help-path-style set-global
SYMBOL: heading-style
H{
{ font-name $ default-sans-serif-font-name }
{ font-size $ font-size-heading }
{ font-style bold }
{ foreground $ heading-color }
} heading-style set-global
SYMBOL: subsection-style
H{
{ font-name $ default-sans-serif-font-name }
{ font-size $ font-size-subsection }
{ font-style bold }
} subsection-style set-global
SYMBOL: snippet-style
H{
{ font-name $ default-monospace-font-name }
{ font-size $ default-font-size }
{ foreground $ snippet-color }
} snippet-style set-global
SYMBOL: code-char-style
H{
{ font-name $ default-monospace-font-name }
{ font-size $ default-font-size }
} code-char-style set-global
SYMBOL: code-style
H{
{ page-color $ code-background-color }
{ inset { 5 5 } }
{ wrap-margin f }
} code-style set-global
SYMBOL: output-style
H{
{ font-style bold }
{ foreground $ output-color }
} output-style set-global
SYMBOL: url-style
H{
{ font-name $ default-monospace-font-name }
{ foreground $ link-color }
} url-style set-global
SYMBOL: warning-style
H{
{ page-color $ warning-background-color }
{ border-color $ warning-border-color }
{ inset { 5 5 } }
{ wrap-margin $ wrap-margin-full }
} warning-style set-global
SYMBOL: deprecated-style
H{
{ page-color $ warning-background-color }
{ border-color $ warning-border-color }
{ inset { 5 5 } }
{ wrap-margin $ wrap-margin-full }
} deprecated-style set-global
SYMBOL: table-content-style
H{
{ wrap-margin $ wrap-margin-table-content }
} table-content-style set-global
SYMBOL: table-style
H{
{ table-gap { 5 5 } }
{ table-border $ table-border-color }
} table-style set-global
SYMBOL: list-style
H{ { table-gap { 10 2 } } } list-style set-global
SYMBOL: bullet
"• " bullet set-global
: adjust-help-font-size ( delta -- )
[
font-size
{
default-span-style title-style
help-path-style heading-style
subsection-style snippet-style
code-char-style
}
] dip '[ get-global [ _ + ] change-at ] with each ;