aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-08-17 19:38:05 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-08-17 19:38:05 +0200
commit994f355fa00f47dbbdd0166594be3c44e39cdcb6 (patch)
tree1fabc071149795c5d948339f31aa015ae70cf558 /module
parentfixes. (diff)
downloadcalp-994f355fa00f47dbbdd0166594be3c44e39cdcb6.tar.gz
calp-994f355fa00f47dbbdd0166594be3c44e39cdcb6.tar.xz
Move tab positioning to stylesheet.
Diffstat (limited to 'module')
-rw-r--r--module/html/components.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/html/components.scm b/module/html/components.scm
index 68c8e763..2580ea55 100644
--- a/module/html/components.scm
+++ b/module/html/components.scm
@@ -101,8 +101,13 @@
`(div (@ (class "tab"))
(input (@ (type "radio") (id ,id) (name ,tabgroup)
,@(when (zero? i) '((checked)))))
+ ;; It would be preferable to place the labels in a separate
+ ;; div and set that to have fixed position, since we could
+ ;; then just flow them. That hovever doesn't work since we
+ ;; need a css-selector for the label to the selected radio
+ ;; option.
(label (@ ,@(assq-merge `((for ,id)
- (style "top: " ,(* 6 i) "ex"))
+ (style "top: calc(var(--tab-size) * " ,i ")"))
(kvlist->assq args)))
,key)
(div (@ (class "content")) ,body)))))