From 16b4af073ca93b0d6387dcee7f7fb88bf251f900 Mon Sep 17 00:00:00 2001 From: mat ess Date: Sun, 14 Aug 2022 13:05:50 -0400 Subject: [PATCH] Accessibility fixes --- sass/style/main.scss | 6 ++ sass/style/theme/light.scss | 2 +- templates/base.html | 8 ++- templates/macros/macros.html | 136 ++++++++++++++++++----------------- templates/posts.html | 8 ++- 5 files changed, 87 insertions(+), 73 deletions(-) diff --git a/sass/style/main.scss b/sass/style/main.scss index f67090d..a183c56 100644 --- a/sass/style/main.scss +++ b/sass/style/main.scss @@ -103,6 +103,12 @@ footer { code { color: var(--text-0); } + + code:hover { + background-color: var(--primary-color); + color: var(--hover-color); + border-radius: 0; + } } // Different sized headers diff --git a/sass/style/theme/light.scss b/sass/style/theme/light.scss index b26db5b..cd6bad8 100644 --- a/sass/style/theme/light.scss +++ b/sass/style/theme/light.scss @@ -3,7 +3,7 @@ --text-1: rgba(0, 0, 0, 66%); --bg-0: #fff; - --bg-1: rgba(169, 169, 169, 30%); + --bg-1: rgba(210, 210, 210, 0.55); --primary-color: lightcoral; --hover-color: white; diff --git a/templates/base.html b/templates/base.html index 8b66d0d..9d17ba1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -9,11 +9,15 @@ {% include "partials/nav.html" %} {# Post page is the default #} -
+
{% block main_content %} Nothing here?! {% endblock main_content %} -
+ + + {% block trailing_content %} + + {% endblock trailing_content %} {% include "partials/footer.html" %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 1e83276..2e9603c 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -55,86 +55,88 @@ {% endmacro content %} {% macro content(page) %} -
-
-
- {{ post_macros::page_header(title=page.title) }} +
+
+ {{ post_macros::page_header(title=page.title) }} - {% if page.date %} -
- Posted on + {% if page.date %} +
+ Posted on - {% if page.draft %} - DRAFT - {% endif %} -
- {% if page.updated %} -
- Updated on -
- {% endif %} -
- {{ page.word_count }} words, {{ page.reading_time }} minute read -
+ {% if page.draft %} + DRAFT {% endif %}
- - {% if page.extra.tldr %} -
- tl;dr: - {{ page.extra.tldr }} + {% if page.updated %} +
+ Updated on
{% endif %} +
+ {{ page.word_count }} words, {{ page.reading_time }} minute read +
+ {% endif %} +
- {# Optional table of contents #} - {% if config.extra.toc | default(value=false) %} - {% if page.toc %} -

Table of Contents

-
    - {% for h1 in page.toc %} -
  • - {{ h1.title }} - {% if h1.children %} + {% if page.extra.tldr %} +
    + tl;dr: + {{ page.extra.tldr }} +
    + {% endif %} + + {# Optional table of contents #} + {% if config.extra.toc | default(value=false) %} + {% if page.toc %} +

    Table of Contents

    +
      + {% for h1 in page.toc %} +
    • + {{ h1.title }} + {% if h1.children %} +
        + {% for h2 in h1.children %} +
      • + {{ h2.title }} +
      • + + {% if h2.children %}
          - {% for h2 in h1.children %} + {% for h3 in h2.children %}
        • - {{ h2.title }} + {{ h3.title }}
        • - - {% if h2.children %} - - {% endif %} {% endfor %}
        {% endif %} - - {% endfor %} -
      - {% endif %} - {% endif %} + {% endfor %} +
    + {% endif %} +
  • + {% endfor %} +
+ {% endif %} + {% endif %} -
- {{ page.content | safe }} -
+
+ {{ page.content | safe }} +
- {% if page.taxonomies and page.taxonomies.tags %} - - {% endif %} -
-
+ {% if page.taxonomies and page.taxonomies.tags %} +
+ this post is tagged with + +
+ {% endif %} + {% endmacro content %} \ No newline at end of file diff --git a/templates/posts.html b/templates/posts.html index 1e346a7..128dacb 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -3,7 +3,7 @@ {% block main_content %} {{ post_macros::page_header(title="blog posts") }} -
+
{%- if paginator %} {%- set show_pages = paginator.pages -%} {% else %} @@ -12,8 +12,10 @@ {% endif -%} {{ post_macros::list_posts(pages=show_pages) }} -
+ +{% endblock main_content %} +{% block trailing_content %} {% if paginator %} {% endif %} -{% endblock main_content %} \ No newline at end of file +{% endblock trailing_content %} \ No newline at end of file