aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-11 20:25:56 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-11 20:25:56 +0200
commit70dd50111a339fd9fcf54cc2f9670c1313a154a0 (patch)
treec41e6339b3fb9db4a176c63f368cd8e8d6538256
parentExpand whitespace. (diff)
downloadcalp-70dd50111a339fd9fcf54cc2f9670c1313a154a0.tar.gz
calp-70dd50111a339fd9fcf54cc2f9670c1313a154a0.tar.xz
Mercge CAL and CAL_bg css classes.
-rw-r--r--module/html/vcomponent.scm20
-rw-r--r--module/html/view/calendar.scm2
-rw-r--r--static/style.css7
3 files changed, 17 insertions, 12 deletions
diff --git a/module/html/vcomponent.scm b/module/html/vcomponent.scm
index 308f779a..1b17f039 100644
--- a/module/html/vcomponent.scm
+++ b/module/html/vcomponent.scm
@@ -50,7 +50,7 @@
;; (format (current-error-port) "fmt-single-event: ~a~%" (prop ev 'X-HNH-FILENAME))
`(article (@ ,@(assq-merge
attributes
- `((class "eventtext CAL_bg_"
+ `((class "eventtext CAL_"
,(html-attr (or (prop (parent ev) 'NAME) "unknown"))
,(when (and (prop ev 'PARTSTAT)
(eq? 'TENTATIVE (prop ev 'PARTSTAT)))
@@ -119,16 +119,14 @@
(define-public (calendar-styles calendars)
`(style
- ,(format
- #f "~:{.CAL_~a { background-color: ~a; color: ~a }~%.CAL_bg_~a { border-color: ~a }~%~}"
- (map (lambda (c)
- (let* ((name (html-attr (prop c 'NAME)))
- (bg-color (prop c 'COLOR))
- (fg-color (and=> (prop c 'COLOR)
- calculate-fg-color)))
- (list name (or bg-color 'white) (or fg-color 'black)
- name (or bg-color 'black))))
- calendars))))
+ ,(format #f "~:{.CAL_~a { --color: ~a; --complement: ~a }~%~}"
+ (map (lambda (c)
+ (let* ((name (html-attr (prop c 'NAME)))
+ (bg-color (prop c 'COLOR))
+ (fg-color (and=> (prop c 'COLOR)
+ calculate-fg-color)))
+ (list name (or bg-color 'white) (or fg-color 'black))))
+ calendars))))
;; "Physical" block in calendar view
(define*-public (make-block ev optional: (extra-attributes '()))
diff --git a/module/html/view/calendar.scm b/module/html/view/calendar.scm
index 7d38140f..4fad41c8 100644
--- a/module/html/view/calendar.scm
+++ b/module/html/view/calendar.scm
@@ -284,7 +284,7 @@
(summary "Calendar list")
(ul ,@(map
(lambda (calendar)
- `(li (@ (class "CAL_bg_"
+ `(li (@ (class "CAL_"
,(html-attr (prop calendar 'NAME))))
,(prop calendar 'NAME)))
calendars))))
diff --git a/static/style.css b/static/style.css
index 3a2a8c5d..28901c8d 100644
--- a/static/style.css
+++ b/static/style.css
@@ -300,6 +300,7 @@ along with their colors.
list-style-type: none;
border-left-width: 1em;
border-left-style: solid;
+ border-color: var(--color);
padding-left: 1ex;
/* force to single line */
@@ -507,6 +508,8 @@ along with their colors.
transition: 0.3s;
font-size: var(--event-font-size);
overflow: visible;
+ background-color: var(--color);
+ color: var(--complement);
}
.popup input {
@@ -607,6 +610,10 @@ along with their colors.
padding-right: 1em;
}
+.eventlist .eventtext {
+ border-color: var(--color);
+}
+
.eventlist .eventtext.tentative {
border-left-style: dashed;
}