| 
									
										
										
										
											2009-01-26 17:25:57 -05:00
										 |  |  | ! Copyright (C) 2005, 2009 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  | USING: assocs colors.constants fonts fry io.styles kernel literals | 
					
						
							| 
									
										
										
										
											2016-05-08 04:09:44 -04:00
										 |  |  | math namespaces sequences ui.theme ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | IN: help.stylesheet | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  | : 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 ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-16 10:26:29 -04:00
										 |  |  | : font-size-span ( -- n )
 | 
					
						
							|  |  |  |     13/12 default-font-size * >integer ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-03-07 03:28:45 -05:00
										 |  |  | SYMBOL: default-span-style | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-sans-serif-font-name } | 
					
						
							| 
									
										
										
										
											2016-04-16 10:26:29 -04:00
										 |  |  |     { font-size $ font-size-span } | 
					
						
							| 
									
										
										
										
											2016-05-04 15:57:04 -04:00
										 |  |  |     { foreground $ text-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { font-style plain } | 
					
						
							| 
									
										
										
										
											2008-03-07 03:28:45 -05:00
										 |  |  | } default-span-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: default-block-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { wrap-margin $ wrap-margin-full } | 
					
						
							| 
									
										
										
										
											2008-03-07 03:28:45 -05:00
										 |  |  | } default-block-style set-global
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: link-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { foreground $ link-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { 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{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-sans-serif-font-name } | 
					
						
							|  |  |  |     { font-size $ font-size-title } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { font-style bold } | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { wrap-margin $ wrap-margin-full } | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { foreground $ title-color } | 
					
						
							| 
									
										
										
										
											2015-08-16 15:54:56 -04:00
										 |  |  |     { page-color COLOR: FactorLightTan } | 
					
						
							| 
									
										
										
										
											2009-09-09 15:50:25 -04:00
										 |  |  |     { inset { 5 5 } } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } title-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: help-path-style | 
					
						
							| 
									
										
										
										
											2009-09-10 09:48:20 -04:00
										 |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-size $ default-font-size } | 
					
						
							| 
									
										
										
										
											2009-09-10 09:48:20 -04:00
										 |  |  |     { table-gap { 5 5 } } | 
					
						
							|  |  |  | } help-path-style set-global
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: heading-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-sans-serif-font-name } | 
					
						
							|  |  |  |     { font-size $ font-size-heading } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { font-style bold } | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { foreground $ heading-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } heading-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: subsection-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-sans-serif-font-name } | 
					
						
							|  |  |  |     { font-size $ font-size-subsection } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { font-style bold } | 
					
						
							|  |  |  | } subsection-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: snippet-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-monospace-font-name } | 
					
						
							|  |  |  |     { font-size $ default-font-size } | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { foreground $ snippet-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } snippet-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-08 12:43:47 -04:00
										 |  |  | SYMBOL: code-char-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-monospace-font-name } | 
					
						
							|  |  |  |     { font-size $ default-font-size } | 
					
						
							| 
									
										
										
										
											2009-09-08 12:43:47 -04:00
										 |  |  | } code-char-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | SYMBOL: code-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { page-color $ code-background-color } | 
					
						
							| 
									
										
										
										
											2009-09-09 15:50:25 -04:00
										 |  |  |     { inset { 5 5 } } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |     { wrap-margin f } | 
					
						
							|  |  |  | } code-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 07:18:48 -05:00
										 |  |  | SYMBOL: output-style | 
					
						
							|  |  |  | H{ | 
					
						
							|  |  |  |     { font-style bold } | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { foreground $ output-color } | 
					
						
							| 
									
										
										
										
											2010-02-17 07:18:48 -05:00
										 |  |  | } output-style set-global
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: url-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { font-name $ default-monospace-font-name } | 
					
						
							| 
									
										
										
										
											2016-05-10 00:34:31 -04:00
										 |  |  |     { foreground $ link-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } url-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: warning-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { page-color $ warning-background-color } | 
					
						
							| 
									
										
										
										
											2016-05-10 00:34:31 -04:00
										 |  |  |     { border-color $ warning-border-color } | 
					
						
							| 
									
										
										
										
											2009-09-09 15:50:25 -04:00
										 |  |  |     { inset { 5 5 } } | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { wrap-margin $ wrap-margin-full } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } warning-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-20 19:36:55 -04:00
										 |  |  | SYMBOL: deprecated-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2016-05-03 13:27:03 -04:00
										 |  |  |     { page-color $ warning-background-color } | 
					
						
							| 
									
										
										
										
											2016-05-10 00:34:31 -04:00
										 |  |  |     { border-color $ warning-border-color } | 
					
						
							| 
									
										
										
										
											2009-09-09 15:50:25 -04:00
										 |  |  |     { inset { 5 5 } } | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { wrap-margin $ wrap-margin-full } | 
					
						
							| 
									
										
										
										
											2009-08-20 19:36:55 -04:00
										 |  |  | } deprecated-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | SYMBOL: table-content-style | 
					
						
							|  |  |  | H{ | 
					
						
							| 
									
										
										
										
											2015-10-24 08:44:30 -04:00
										 |  |  |     { wrap-margin $ wrap-margin-table-content } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } table-content-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: table-style | 
					
						
							|  |  |  | H{ | 
					
						
							|  |  |  |     { table-gap { 5 5 } } | 
					
						
							| 
									
										
										
										
											2016-10-22 12:24:15 -04:00
										 |  |  |     { table-border $ table-border-color } | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | } table-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: list-style | 
					
						
							|  |  |  | H{ { table-gap { 10 2 } } } list-style set-global
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: bullet | 
					
						
							| 
									
										
										
										
											2009-02-04 01:51:47 -05:00
										 |  |  | "• " bullet set-global
 | 
					
						
							| 
									
										
										
										
											2012-08-07 11:36:16 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : adjust-help-font-size ( delta -- )
 | 
					
						
							|  |  |  |     [ | 
					
						
							|  |  |  |         font-size | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2012-08-07 17:50:27 -04:00
										 |  |  |             default-span-style title-style | 
					
						
							|  |  |  |             help-path-style heading-style | 
					
						
							|  |  |  |             subsection-style snippet-style | 
					
						
							|  |  |  |             code-char-style | 
					
						
							| 
									
										
										
										
											2012-08-07 11:36:16 -04:00
										 |  |  |         } | 
					
						
							|  |  |  |     ] dip '[ get-global [ _ + ] change-at ] with each ;
 |