]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/help/stylesheet/stylesheet.factor
ui.theme: updates to color scheme.
[factor.git] / basis / help / stylesheet / stylesheet.factor
index 74d7f6c115f20210546447e25a36360daaae42bb..fe5a6984b8ba0f471faf5ba21ebdeec9ac9b3092 100644 (file)
@@ -1,23 +1,43 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io.styles namespaces colors colors.constants ;
+USING: assocs colors.constants fonts fry io.styles kernel literals
+math namespaces sequences ui.theme ;
 IN: help.stylesheet
 
+: 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 ;
+
+: font-size-span ( -- n )
+    13/12 default-font-size * >integer ;
+
 SYMBOL: default-span-style
 H{
-    { font-name "sans-serif" }
-    { font-size 12 }
+    { font-name $ default-sans-serif-font-name }
+    { font-size $ font-size-span }
+    { foreground $ text-color }
     { font-style plain }
 } default-span-style set-global
 
 SYMBOL: default-block-style
 H{
-    { wrap-margin 500 }
+    { wrap-margin $ wrap-margin-full }
 } default-block-style set-global
 
 SYMBOL: link-style
 H{
-    { foreground COLOR: dark-blue }
+    { foreground $ link-color }
     { font-style bold }
 } link-style set-global
 
@@ -29,71 +49,93 @@ H{ { font-style bold } } strong-style set-global
 
 SYMBOL: title-style
 H{
-    { font-name "sans-serif" }
-    { font-size 18 }
+    { font-name $ default-sans-serif-font-name }
+    { font-size $ font-size-title }
     { font-style bold }
-    { wrap-margin 500 }
-    { page-color COLOR: light-gray }
-    { border-width 5 }
+    { wrap-margin $ wrap-margin-full }
+    { foreground $ title-color }
+    { page-color COLOR: FactorLightTan }
+    { inset { 5 5 } }
 } title-style set-global
 
 SYMBOL: help-path-style
-H{ { font-size 10 } } help-path-style set-global
+H{
+    { font-size $ default-font-size }
+    { table-gap { 5 5 } }
+} help-path-style set-global
 
 SYMBOL: heading-style
 H{
-    { font-name "sans-serif" }
-    { font-size 16 }
+    { font-name $ default-sans-serif-font-name }
+    { font-size $ font-size-heading }
     { font-style bold }
+    { foreground $ heading-color }
 } heading-style set-global
 
 SYMBOL: subsection-style
 H{
-    { font-name "sans-serif" }
-    { font-size 14 }
+    { font-name $ default-sans-serif-font-name }
+    { font-size $ font-size-subsection }
     { font-style bold }
 } subsection-style set-global
 
 SYMBOL: snippet-style
 H{
-    { font-name "monospace" }
-    { font-size 12 }
-    { foreground COLOR: navy-blue }
+    { font-name $ default-monospace-font-name }
+    { font-size $ default-font-size }
+    { foreground $ snippet-color }
 } snippet-style set-global
 
+SYMBOL: code-char-style
+H{
+    { font-name $ default-monospace-font-name }
+    { font-size $ default-font-size }
+} code-char-style set-global
+
 SYMBOL: code-style
 H{
-    { page-color COLOR: gray80 }
-    { border-width 5 }
+    { page-color $ code-background-color }
+    { inset { 5 5 } }
     { wrap-margin f }
 } code-style set-global
 
-SYMBOL: input-style
-H{ { font-style bold } } input-style set-global
+SYMBOL: output-style
+H{
+    { font-style bold }
+    { foreground $ output-color }
+} output-style set-global
 
 SYMBOL: url-style
 H{
-    { font-name "monospace" }
-    { foreground COLOR: blue }
+    { font-name $ default-monospace-font-name }
+    { foreground $ link-color }
 } url-style set-global
 
 SYMBOL: warning-style
 H{
-    { page-color COLOR: gray90 }
-    { border-color COLOR: red }
-    { border-width 5 }
-    { wrap-margin 500 }
+    { page-color $ warning-background-color }
+    { border-color $ warning-border-color }
+    { inset { 5 5 } }
+    { wrap-margin $ wrap-margin-full }
 } warning-style set-global
 
+SYMBOL: deprecated-style
+H{
+    { page-color $ warning-background-color }
+    { border-color $ warning-border-color }
+    { inset { 5 5 } }
+    { wrap-margin $ wrap-margin-full }
+} deprecated-style set-global
+
 SYMBOL: table-content-style
 H{
-    { wrap-margin 350 }
+    { wrap-margin $ wrap-margin-table-content }
 } table-content-style set-global
 
 SYMBOL: table-style
 H{
     { table-gap { 5 5 } }
-    { table-border COLOR: light-gray }
+    { table-border $ line-color }
 } table-style set-global
 
 SYMBOL: list-style
@@ -101,3 +143,14 @@ H{ { table-gap { 10 2 } } } list-style set-global
 
 SYMBOL: bullet
 "• " bullet set-global
+
+: adjust-help-font-size ( delta -- )
+    [
+        font-size
+        {
+            default-span-style title-style
+            help-path-style heading-style
+            subsection-style snippet-style
+            code-char-style
+        }
+    ] dip '[ get-global [ _ + ] change-at ] with each ;