From 7dd217a78e99ecb7783c6b451c6b8c8cc8aa91f1 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sun, 4 Aug 2024 13:02:07 +0200 Subject: [PATCH] feat: replace accordion implementation with details/summary Migrated accordion elements from a Bootstrap-based approach to using the native HTML
and tags for better accessibility and reduced reliance on third-party libraries. Enhanced CSS for the accordion components to style hover effects and manage open states effectively. Simplified icon handling within accordion bodies. --- assets/css/base.css | 23 ++++++++--- templates/index.html | 90 ++++++++++++++++++-------------------------- 2 files changed, 53 insertions(+), 60 deletions(-) diff --git a/assets/css/base.css b/assets/css/base.css index b3f452a..9d4d7a3 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -280,19 +280,30 @@ h5 { border: 1px solid #ddd; border-radius: 5px; } + .accordion-item { border-bottom: 1px solid #ddd; + margin-bottom: 1rem; } + .accordion-header { padding: 1rem; cursor: pointer; -} -.accordion-button { - background: none; - border: none; - outline: none; + background-color: #f9f9f9; font-size: 1.25rem; + font-weight: bold; + border-bottom: 1px solid #ddd; } -.accordion-collapse { + +.accordion-header:hover { + background-color: #e9e9e9; +} + +.accordion-body { padding: 1rem; + display: none; +} + +.accordion-item[open] .accordion-body { + display: block; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 8066de4..05f7a5e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -36,69 +36,51 @@
-
+
{% for service in services.services %} {% if not service.exclude_from_index %} -
-

- -

-
-
- {% if service.icon %} + {{ service.icon | icon | safe }} {% if service.homemade %}
- {{ service.icon | icon | safe }} {% if service.homemade %} -
- {{ "coffee" | icon | safe }} -
- {% endif %} + {{ "coffee" | icon | safe }}
{% endif %} -

- {{ service.long_description }} -

- {% for link in service.links %} {% if link.alternatives %} - - {% else %} - {{ link.name }} - {% endif %} {% endfor %}
+ {% endif %} +

+ {{ service.long_description }} +

+ {% for link in service.links %} {% if link.alternatives %} + + {% else %} + {{ link.name }} + {% endif %} {% endfor %}
-
+
{% endif %} {% endfor %}