aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-02-23 00:34:04 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-02-23 00:34:20 +0100
commitc466b6caaa7b6dce2c45075ce1b31235ff90cd34 (patch)
treed0ed25e04bef865c196a5b4213ace7e51ed89310 /module
parentadd dirty hack to handle "some" bad HTML. (diff)
downloadcalp-c466b6caaa7b6dce2c45075ce1b31235ff90cd34.tar.gz
calp-c466b6caaa7b6dce2c45075ce1b31235ff90cd34.tar.xz
Add rudementary dark theme.
Diffstat (limited to 'module')
-rw-r--r--module/output/html.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 75586468..e8c0a266 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -156,11 +156,17 @@
,time ":00")))
(iota 12 0 2))))))
-(define (include-css path)
+(define (include-css path . extra-attributes)
`(link (@ (type "text/css")
(rel "stylesheet")
- (href ,path))))
+ (href ,path)
+ ,@extra-attributes)))
+(define (include-alt-css path . extra-attributes)
+ `(link (@ (type "text/css")
+ (rel "alternate stylesheet")
+ (href ,path)
+ ,@extra-attributes)))
(define (fmt-time-span ev)
(cond [(attr ev 'DTSTART) date?
@@ -304,6 +310,8 @@
(content "Calendar for the dates between " ,(date->string start-date)
" and " ,(date->string end-date))))
,(include-css "static/style.css")
+ ,(include-alt-css "static/dark.css" '(title "Dark"))
+ ,(include-alt-css "static/light.css" '(title "Light"))
(script (@ (src "static/script.js")) "")
(style ,(format #f "~:{.CAL_~a { background-color: ~a; color: ~a }~%.CAL_bg_~a { border-color: ~a }~%~}"
(map (lambda (c)