1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs colors.constants fonts fry io.styles kernel literals
4 math namespaces sequences ui.gadgets.theme ;
7 : wrap-margin-full ( -- n )
8 42 default-font-size * ;
10 : wrap-margin-table-content ( -- n )
11 29 default-font-size * ;
13 : font-size-subsection ( -- n )
14 7/6 default-font-size * >integer ;
16 : font-size-title ( -- n )
17 5/3 default-font-size * >integer ;
19 : font-size-heading ( -- n )
20 4/3 default-font-size * >integer ;
22 : font-size-span ( -- n )
23 13/12 default-font-size * >integer ;
25 SYMBOL: default-span-style
27 { font-name $ default-sans-serif-font-name }
28 { font-size $ font-size-span }
29 { foreground $ text-color }
31 } default-span-style set-global
33 SYMBOL: default-block-style
35 { wrap-margin $ wrap-margin-full }
36 } default-block-style set-global
40 { foreground $ link-color }
42 } link-style set-global
44 SYMBOL: emphasis-style
45 H{ { font-style italic } } emphasis-style set-global
48 H{ { font-style bold } } strong-style set-global
52 { font-name $ default-sans-serif-font-name }
53 { font-size $ font-size-title }
55 { wrap-margin $ wrap-margin-full }
56 { foreground $ title-color }
57 { page-color COLOR: FactorLightTan }
59 } title-style set-global
61 SYMBOL: help-path-style
63 { font-size $ default-font-size }
65 } help-path-style set-global
69 { font-name $ default-sans-serif-font-name }
70 { font-size $ font-size-heading }
72 { foreground $ heading-color }
73 } heading-style set-global
75 SYMBOL: subsection-style
77 { font-name $ default-sans-serif-font-name }
78 { font-size $ font-size-subsection }
80 } subsection-style set-global
84 { font-name $ default-monospace-font-name }
85 { font-size $ default-font-size }
86 { foreground $ snippet-color }
87 } snippet-style set-global
89 SYMBOL: code-char-style
91 { font-name $ default-monospace-font-name }
92 { font-size $ default-font-size }
93 } code-char-style set-global
97 { page-color $ code-background-color }
100 } code-style set-global
105 { foreground $ output-color }
106 } output-style set-global
110 { font-name $ default-monospace-font-name }
111 { foreground $ url-color }
112 } url-style set-global
114 SYMBOL: warning-style
116 { page-color $ warning-background-color }
118 { wrap-margin $ wrap-margin-full }
119 } warning-style set-global
121 SYMBOL: deprecated-style
123 { page-color $ warning-background-color }
125 { wrap-margin $ wrap-margin-full }
126 } deprecated-style set-global
128 SYMBOL: table-content-style
130 { wrap-margin $ wrap-margin-table-content }
131 } table-content-style set-global
135 { table-gap { 5 5 } }
136 { table-border $ line-color }
137 } table-style set-global
140 H{ { table-gap { 10 2 } } } list-style set-global
143 "• " bullet set-global
145 : adjust-help-font-size ( delta -- )
149 default-span-style title-style
150 help-path-style heading-style
151 subsection-style snippet-style
154 ] dip '[ get-global [ _ + ] change-at ] with each ;