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 }
30 } default-span-style set-global
32 SYMBOL: default-block-style
34 { wrap-margin $ wrap-margin-full }
35 } default-block-style set-global
39 { foreground $ link-color }
41 } link-style set-global
43 SYMBOL: emphasis-style
44 H{ { font-style italic } } emphasis-style set-global
47 H{ { font-style bold } } strong-style set-global
51 { font-name $ default-sans-serif-font-name }
52 { font-size $ font-size-title }
54 { wrap-margin $ wrap-margin-full }
55 { foreground $ title-color }
56 { page-color COLOR: FactorLightTan }
58 } title-style set-global
60 SYMBOL: help-path-style
62 { font-size $ default-font-size }
64 } help-path-style set-global
68 { font-name $ default-sans-serif-font-name }
69 { font-size $ font-size-heading }
71 { foreground $ heading-color }
72 } heading-style set-global
74 SYMBOL: subsection-style
76 { font-name $ default-sans-serif-font-name }
77 { font-size $ font-size-subsection }
79 } subsection-style set-global
83 { font-name $ default-monospace-font-name }
84 { font-size $ default-font-size }
85 { foreground $ snippet-color }
86 } snippet-style set-global
88 SYMBOL: code-char-style
90 { font-name $ default-monospace-font-name }
91 { font-size $ default-font-size }
92 } code-char-style set-global
96 { page-color $ code-background-color }
99 } code-style set-global
104 { foreground $ output-color }
105 } output-style set-global
109 { font-name $ default-monospace-font-name }
110 { foreground $ url-color }
111 } url-style set-global
113 SYMBOL: warning-style
115 { page-color $ warning-background-color }
117 { wrap-margin $ wrap-margin-full }
118 } warning-style set-global
120 SYMBOL: deprecated-style
122 { page-color $ warning-background-color }
124 { wrap-margin $ wrap-margin-full }
125 } deprecated-style set-global
127 SYMBOL: table-content-style
129 { wrap-margin $ wrap-margin-table-content }
130 } table-content-style set-global
134 { table-gap { 5 5 } }
135 { table-border $ line-color }
136 } table-style set-global
139 H{ { table-gap { 10 2 } } } list-style set-global
142 "• " bullet set-global
144 : adjust-help-font-size ( delta -- )
148 default-span-style title-style
149 help-path-style heading-style
150 subsection-style snippet-style
153 ] dip '[ get-global [ _ + ] change-at ] with each ;