1 ! Copyright (C) 2016 Nicolas PĂ©net.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: fry hashtables help.stylesheet help.tips io.styles
4 kernel listener namespaces ui.gadgets.theme ui.tools.listener ;
5 IN: ui.gadgets.theme.switching
7 : (update-style) ( style color elt -- )
8 '[ _ _ rot ?set-at ] change-global ;
10 : update-stylesheet ( -- )
11 default-span-style text-color foreground (update-style)
12 link-style link-color foreground (update-style)
13 title-style title-color foreground (update-style)
14 heading-style heading-color foreground (update-style)
15 snippet-style snippet-color foreground (update-style)
16 code-style code-background-color page-color (update-style)
17 output-style output-color foreground (update-style)
18 url-style url-color foreground (update-style)
19 warning-style warning-background-color page-color (update-style)
20 deprecated-style warning-background-color page-color (update-style)
21 table-style line-color table-border (update-style)
22 prompt-style prompt-background-color background (update-style)
23 prompt-style text-color foreground (update-style)
24 tip-of-the-day-style tip-background-color page-color (update-style)
25 listener-input-style text-color foreground (update-style)
26 listener-word-style text-color foreground (update-style) ;
28 : light-mode ( -- ) light-theme theme set-global update-stylesheet ;
29 : dark-mode ( -- ) dark-theme theme set-global update-stylesheet ;