From 57a4bfdb8293c2bc44650dd1769f883d94219f56 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 27 Oct 2020 05:14:33 +0800 Subject: [PATCH] Replace heading elements of panel with span. Fix the heading levels audit. --- _includes/panel.html | 15 ++++++--------- assets/css/_addon/main.scss | 11 +++-------- assets/css/_addon/module.scss | 11 +++++++++++ assets/css/post.scss | 5 ++--- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/_includes/panel.html b/_includes/panel.html index b70a9b277..35997c2a4 100644 --- a/_includes/panel.html +++ b/_includes/panel.html @@ -17,9 +17,7 @@ {% if update_list.size > 0 %}
-

- {{- site.data.label.panel.lastmod -}} -

+ {{- site.data.label.panel.lastmod -}}
    {% for item in update_list %} @@ -44,15 +42,14 @@ {% if trending_tags.size > 0 %}
    -

    - {{- site.data.label.panel.trending_tags -}} -

    + {{- site.data.label.panel.trending_tags -}}
    - + {% for tag in trending_tags %} {% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %} {{ tag | replace: '-', ' ' }} {% endfor %} +
    {% endif %} @@ -60,9 +57,9 @@ {% if page.layout == 'post' and site.toc and page.toc %}
    -

    + {{- site.data.label.panel.toc -}} -

    +
    {% endif %} diff --git a/assets/css/_addon/main.scss b/assets/css/_addon/main.scss index 6352dd078..91b97ac85 100644 --- a/assets/css/_addon/main.scss +++ b/assets/css/_addon/main.scss @@ -516,20 +516,15 @@ footer { &.topbar-down { top: 6rem; } - >div { + > div { padding-left: 1rem; border-left: 1px solid var(--main-border-color); &:not(:last-child) { margin-bottom: 4rem; } } - h3 { - padding-top: .5rem; - padding-bottom: .5rem; - margin-top: 0; - margin-bottom: 0; - letter-spacing: -0.02em; - @include label(inherit, 600); + span { + @include panel-label; } .post-content { font-size: .9rem; diff --git a/assets/css/_addon/module.scss b/assets/css/_addon/module.scss index 6335ebf1a..283fe56e4 100644 --- a/assets/css/_addon/module.scss +++ b/assets/css/_addon/module.scss @@ -99,6 +99,17 @@ font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif; } +@mixin panel-label { + display: block; + line-height: 1.2; + padding-top: .5rem; + padding-bottom: .5rem; + margin-top: 0; + margin-bottom: 0; + letter-spacing: -0.02em; + @include label(inherit); +} + @mixin align-center { position: relative; left: 50%; diff --git a/assets/css/post.scss b/assets/css/post.scss index 825cd463d..8a57d8e25 100644 --- a/assets/css/post.scss +++ b/assets/css/post.scss @@ -132,7 +132,6 @@ $prompt-newer: "{{ site.data.label.post.button.next }}"; } #toc-wrapper { - margin-top: 7rem; border-left: 1px solid rgba(158, 158, 158, 0.17); position: -webkit-sticky; position: sticky; @@ -142,8 +141,8 @@ $prompt-newer: "{{ site.data.label.post.button.next }}"; &.topbar-down { top: 6rem; } - >h3 { - @include label(inherit, 600); + > span { + @include panel-label; } }