From c466b6caaa7b6dce2c45075ce1b31235ff90cd34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 23 Feb 2020 00:34:04 +0100 Subject: Add rudementary dark theme. --- module/output/html.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'module') 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) -- cgit v1.2.3