]> gitweb.factorcode.org Git - factor.git/blob - basis/help/stylesheet/stylesheet.factor
ui.theme: updates to color scheme.
[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.constants fonts fry io.styles kernel literals
4 math namespaces sequences ui.theme ;
5 IN: help.stylesheet
6
7 : wrap-margin-full ( -- n )
8     42 default-font-size * ;
9
10 : wrap-margin-table-content ( -- n )
11     29 default-font-size * ;
12
13 : font-size-subsection ( -- n )
14     7/6 default-font-size * >integer ;
15
16 : font-size-title ( -- n )
17     5/3 default-font-size * >integer ;
18
19 : font-size-heading ( -- n )
20     4/3 default-font-size * >integer ;
21
22 : font-size-span ( -- n )
23     13/12 default-font-size * >integer ;
24
25 SYMBOL: default-span-style
26 H{
27     { font-name $ default-sans-serif-font-name }
28     { font-size $ font-size-span }
29     { foreground $ text-color }
30     { font-style plain }
31 } default-span-style set-global
32
33 SYMBOL: default-block-style
34 H{
35     { wrap-margin $ wrap-margin-full }
36 } default-block-style set-global
37
38 SYMBOL: link-style
39 H{
40     { foreground $ link-color }
41     { font-style bold }
42 } link-style set-global
43
44 SYMBOL: emphasis-style
45 H{ { font-style italic } } emphasis-style set-global
46
47 SYMBOL: strong-style
48 H{ { font-style bold } } strong-style set-global
49
50 SYMBOL: title-style
51 H{
52     { font-name $ default-sans-serif-font-name }
53     { font-size $ font-size-title }
54     { font-style bold }
55     { wrap-margin $ wrap-margin-full }
56     { foreground $ title-color }
57     { page-color COLOR: FactorLightTan }
58     { inset { 5 5 } }
59 } title-style set-global
60
61 SYMBOL: help-path-style
62 H{
63     { font-size $ default-font-size }
64     { table-gap { 5 5 } }
65 } help-path-style set-global
66
67 SYMBOL: heading-style
68 H{
69     { font-name $ default-sans-serif-font-name }
70     { font-size $ font-size-heading }
71     { font-style bold }
72     { foreground $ heading-color }
73 } heading-style set-global
74
75 SYMBOL: subsection-style
76 H{
77     { font-name $ default-sans-serif-font-name }
78     { font-size $ font-size-subsection }
79     { font-style bold }
80 } subsection-style set-global
81
82 SYMBOL: snippet-style
83 H{
84     { font-name $ default-monospace-font-name }
85     { font-size $ default-font-size }
86     { foreground $ snippet-color }
87 } snippet-style set-global
88
89 SYMBOL: code-char-style
90 H{
91     { font-name $ default-monospace-font-name }
92     { font-size $ default-font-size }
93 } code-char-style set-global
94
95 SYMBOL: code-style
96 H{
97     { page-color $ code-background-color }
98     { inset { 5 5 } }
99     { wrap-margin f }
100 } code-style set-global
101
102 SYMBOL: output-style
103 H{
104     { font-style bold }
105     { foreground $ output-color }
106 } output-style set-global
107
108 SYMBOL: url-style
109 H{
110     { font-name $ default-monospace-font-name }
111     { foreground $ link-color }
112 } url-style set-global
113
114 SYMBOL: warning-style
115 H{
116     { page-color $ warning-background-color }
117     { border-color $ warning-border-color }
118     { inset { 5 5 } }
119     { wrap-margin $ wrap-margin-full }
120 } warning-style set-global
121
122 SYMBOL: deprecated-style
123 H{
124     { page-color $ warning-background-color }
125     { border-color $ warning-border-color }
126     { inset { 5 5 } }
127     { wrap-margin $ wrap-margin-full }
128 } deprecated-style set-global
129
130 SYMBOL: table-content-style
131 H{
132     { wrap-margin $ wrap-margin-table-content }
133 } table-content-style set-global
134
135 SYMBOL: table-style
136 H{
137     { table-gap { 5 5 } }
138     { table-border $ line-color }
139 } table-style set-global
140
141 SYMBOL: list-style
142 H{ { table-gap { 10 2 } } } list-style set-global
143
144 SYMBOL: bullet
145 "• " bullet set-global
146
147 : adjust-help-font-size ( delta -- )
148     [
149         font-size
150         {
151             default-span-style title-style
152             help-path-style heading-style
153             subsection-style snippet-style
154             code-char-style
155         }
156     ] dip '[ get-global [ _ + ] change-at ] with each ;