]> gitweb.factorcode.org Git - factor.git/blob - basis/help/stylesheet/stylesheet.factor
help.stylesheet: provide a mechanism to adjust the help fonts.
[factor.git] / basis / help / stylesheet / stylesheet.factor
1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs colors colors.constants fry io.styles kernel
4 math namespaces sequences ;
5 IN: help.stylesheet
6
7 SYMBOL: default-span-style
8 H{
9     { font-name "sans-serif" }
10     { font-size 12 }
11     { font-style plain }
12 } default-span-style set-global
13
14 SYMBOL: default-block-style
15 H{
16     { wrap-margin 500 }
17 } default-block-style set-global
18
19 SYMBOL: link-style
20 H{
21     { foreground COLOR: DodgerBlue4 }
22     { font-style bold }
23 } link-style set-global
24
25 SYMBOL: emphasis-style
26 H{ { font-style italic } } emphasis-style set-global
27
28 SYMBOL: strong-style
29 H{ { font-style bold } } strong-style set-global
30
31 SYMBOL: title-style
32 H{
33     { font-name "sans-serif" }
34     { font-size 20 }
35     { font-style bold }
36     { wrap-margin 500 }
37     { foreground COLOR: gray20 }
38     { page-color COLOR: FactorLightTan }
39     { inset { 5 5 } }
40 } title-style set-global
41
42 SYMBOL: help-path-style
43 H{
44     { font-size 10 }
45     { table-gap { 5 5 } }
46     { table-border COLOR: FactorLightTan }
47 } help-path-style set-global
48
49 SYMBOL: heading-style
50 H{
51     { font-name "sans-serif" }
52     { font-size 16 }
53     { font-style bold }
54     { foreground COLOR: FactorDarkSlateBlue }
55 } heading-style set-global
56
57 SYMBOL: subsection-style
58 H{
59     { font-name "sans-serif" }
60     { font-size 14 }
61     { font-style bold }
62 } subsection-style set-global
63
64 SYMBOL: snippet-style
65 H{
66     { font-name "monospace" }
67     { font-size 12 }
68     { foreground COLOR: DarkOrange4 }
69 } snippet-style set-global
70
71 SYMBOL: code-char-style
72 H{
73     { font-name "monospace" }
74     { font-size 12 }
75 } code-char-style set-global
76
77 SYMBOL: code-style
78 H{
79     { page-color COLOR: FactorLightTan }
80     { inset { 5 5 } }
81     { wrap-margin f }
82 } code-style set-global
83
84 SYMBOL: output-style
85 H{
86     { font-style bold }
87     { foreground COLOR: DarkOrange4 }
88 } output-style set-global
89
90 SYMBOL: url-style
91 H{
92     { font-name "monospace" }
93     { foreground COLOR: DodgerBlue4 }
94 } url-style set-global
95
96 SYMBOL: warning-style
97 H{
98     { page-color COLOR: gray90 }
99     { border-color COLOR: red }
100     { inset { 5 5 } }
101     { wrap-margin 500 }
102 } warning-style set-global
103
104 SYMBOL: deprecated-style
105 H{
106     { page-color COLOR: gray90 }
107     { border-color COLOR: red }
108     { inset { 5 5 } }
109     { wrap-margin 500 }
110 } deprecated-style set-global
111
112 SYMBOL: table-content-style
113 H{
114     { wrap-margin 350 }
115 } table-content-style set-global
116
117 SYMBOL: table-style
118 H{
119     { table-gap { 5 5 } }
120     { table-border COLOR: FactorTan }
121 } table-style set-global
122
123 SYMBOL: list-style
124 H{ { table-gap { 10 2 } } } list-style set-global
125
126 SYMBOL: bullet
127 "• " bullet set-global
128
129 : adjust-help-font-size ( delta -- )
130     [
131         font-size
132         {
133             default-span-style title-style heading-style
134             subsection-style snippet-style code-char-style
135         }
136     ] dip '[ get-global [ _ + ] change-at ] with each ;