From cb1c9449b8c6df2fe2fda3780afef5a4301c043f Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Mon, 29 Jul 2024 10:34:19 -0400 Subject: [PATCH 1/2] index: migrate from label to badge (Bootstrap 3 -> 4/5) --- index.php | 2 +- styles.css | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/index.php b/index.php index cc796e27..0529c22f 100755 --- a/index.php +++ b/index.php @@ -156,7 +156,7 @@ $oldtable->data[] = $row; } else { if ($inprogress) { - $label = html_writer::tag('span', $strmeetingstarted, ['class' => 'label label-info zoom-info']); + $label = html_writer::tag('span', $strmeetingstarted, ['class' => 'badge bg-info text-dark']); $row[2] = html_writer::tag('div', $label); } else { $row[2] = $displaytime; diff --git a/styles.css b/styles.css index a695cb2f..6da60f8f 100644 --- a/styles.css +++ b/styles.css @@ -1,9 +1,3 @@ -.zoom-info { - padding: 0.2em 0.6em 0.3em; - color: #fff; - border-radius: 0.25em; -} - #page-mod-zoom-view a .btn-primary .icon { color: white; } From 4a7c22295bfbaef9b79493f1f59e7b12fb529f17 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Thu, 1 Aug 2024 12:26:21 -0400 Subject: [PATCH 2/2] index: use dark badge styles Even with the backward/forward compatibility, bg-info text-dark was not sufficient contrast for WCAG 2.x AA. Forcing text-dark also had the drawback of not working well in "dark mode" themes. So if we can't use text-dark, then Bootstrap 5.0 and 5.1 will need to use the default text color. That leaves "primary", "secondary", "success", "danger" and "dark". primary and secondary are already used for buttons to Join or Cancel. success did not have sufficient contrast in all versions that we tested. danger is specifically designed to scare/alert people, so that seemed wrong. dark is the only option that has sufficient contrast, isn't designed to scare people, and does not conflict with the mental model of action buttons. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 0529c22f..6c714ece 100755 --- a/index.php +++ b/index.php @@ -156,7 +156,7 @@ $oldtable->data[] = $row; } else { if ($inprogress) { - $label = html_writer::tag('span', $strmeetingstarted, ['class' => 'badge bg-info text-dark']); + $label = html_writer::tag('span', $strmeetingstarted, ['class' => 'badge bg-dark badge-dark bg-text-dark']); $row[2] = html_writer::tag('div', $label); } else { $row[2] = $displaytime;