diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-02-23 00:34:04 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-02-23 00:34:20 +0100 |
commit | c466b6caaa7b6dce2c45075ce1b31235ff90cd34 (patch) | |
tree | d0ed25e04bef865c196a5b4213ace7e51ed89310 | |
parent | add dirty hack to handle "some" bad HTML. (diff) | |
download | calp-c466b6caaa7b6dce2c45075ce1b31235ff90cd34.tar.gz calp-c466b6caaa7b6dce2c45075ce1b31235ff90cd34.tar.xz |
Add rudementary dark theme.
-rw-r--r-- | module/output/html.scm | 12 | ||||
-rw-r--r-- | static/dark.css | 12 | ||||
-rw-r--r-- | static/light.css | 12 | ||||
-rw-r--r-- | static/style.css | 1 |
4 files changed, 35 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) diff --git a/static/dark.css b/static/dark.css new file mode 100644 index 00000000..f53d8027 --- /dev/null +++ b/static/dark.css @@ -0,0 +1,12 @@ +main { + background-color: black; + color: white; +} + +main a { + color: lightblue; +} + +main .day { + border-color: white; +} diff --git a/static/light.css b/static/light.css new file mode 100644 index 00000000..05c05d56 --- /dev/null +++ b/static/light.css @@ -0,0 +1,12 @@ +main { + background-color: white; + color: black; +} + +main a { + color: blue; +} + +main .day { + border-color: black; +} diff --git a/static/style.css b/static/style.css index e01eef32..ec249956 100644 --- a/static/style.css +++ b/static/style.css @@ -343,5 +343,6 @@ body { width: calc(100% + 2em); height: 4px; background: blue; + border-color: blue; left: -1em; } |