Optimize semantic elements' name

This commit is contained in:
Mimi 2022-11-10 00:11:53 +08:00
parent c7b92c3af8
commit b78fb3ac90
12 changed files with 16 additions and 18 deletions

View File

@ -15,14 +15,14 @@
<div class="headband"></div> <div class="headband"></div>
<main class="main"> <main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="column">
<div class="header-inner"> <header class="header" itemscope itemtype="http://schema.org/WPHeader">
{%- include '_partials/header/index.njk' -%} {%- include '_partials/header/index.njk' -%}
</div> </header>
{%- if theme.sidebar.display !== 'remove' %} {%- if theme.sidebar.display !== 'remove' %}
{% block sidebar %}{% endblock %} {% block sidebar %}{% endblock %}
{%- endif %} {%- endif %}
</header> </div>
<div class="main-inner {% block class %}{% endblock %}"> <div class="main-inner {% block class %}{% endblock %}">
{%- include '_partials/header/sub-menu.njk' -%} {%- include '_partials/header/sub-menu.njk' -%}

View File

@ -1,6 +1,5 @@
{% macro render(display_toc) %} {% macro render(display_toc) %}
<aside class="sidebar"> <aside class="sidebar">
{%- set display_toc = page.toc.enable and display_toc %}
{%- if display_toc %} {%- if display_toc %}
{%- set toc = toc(page.content, {class: 'nav', list_number: page.toc.number, max_depth: page.toc.max_depth}) %} {%- set toc = toc(page.content, {class: 'nav', list_number: page.toc.number, max_depth: page.toc.max_depth}) %}
{%- set display_toc = toc.length > 1 and display_toc %} {%- set display_toc = toc.length > 1 and display_toc %}

View File

@ -50,5 +50,5 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{{ sidebar_template.render(true) }} {{ sidebar_template.render(page.toc.enable) }}
{% endblock %} {% endblock %}

View File

@ -12,5 +12,5 @@
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
{{ sidebar_template.render(true) }} {{ sidebar_template.render(page.toc.enable) }}
{% endblock %} {% endblock %}

View File

@ -9,12 +9,11 @@
} }
} }
// Fix issue #521 .column {
header.header {
background: $head-bg; background: $head-bg;
} }
.header-inner { .header {
main-container(); main-container();
} }
@ -25,7 +24,7 @@ header.header {
} }
.use-motion { .use-motion {
header.header, .site-brand-container .toggle { .column, .site-brand-container .toggle {
opacity: 0; opacity: 0;
} }
} }

View File

@ -1,6 +1,6 @@
// Header // Header
// -------------------------------------------------- // --------------------------------------------------
.header-inner { .header {
align-items: center; align-items: center;
display: flex; display: flex;
padding: 20px 0; padding: 20px 0;

View File

@ -9,7 +9,7 @@
background: var(--btn-default-bg); background: var(--btn-default-bg);
} }
.header-inner { .header {
padding-top: 100px; padding-top: 100px;
+mobile() { +mobile() {

View File

@ -7,7 +7,7 @@
} }
} }
.header-inner, .main-inner, .footer-inner { .header, .main-inner, .footer-inner {
+mobile() { +mobile() {
width: auto; width: auto;
} }

View File

@ -1,4 +1,4 @@
.header-inner { .header {
background: var(--content-bg-color); background: var(--content-bg-color);
border-radius: $border-radius-inner; border-radius: $border-radius-inner;
box-shadow: $box-shadow-inner; box-shadow: $box-shadow-inner;

View File

@ -11,7 +11,7 @@ body { margin-top: 2rem; }
visibility: visible; visibility: visible;
} }
.use-motion header.header, .use-motion .column,
.use-motion .site-brand-container .toggle, .use-motion .site-brand-container .toggle,
.use-motion .footer { opacity: initial; } .use-motion .footer { opacity: initial; }

View File

@ -51,7 +51,7 @@ NexT.motion.middleWares = {
}); });
} }
pushToSequence('header.header'); pushToSequence('.column');
CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line'); CONFIG.scheme === 'Mist' && getMistLineSettings('.logo-line');
CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image'); CONFIG.scheme === 'Muse' && pushToSequence('.custom-logo-image');
pushToSequence('.site-title'); pushToSequence('.site-title');

View File

@ -50,7 +50,7 @@ document.addEventListener('DOMContentLoaded', () => {
function updateFooterPosition() { function updateFooterPosition() {
const footer = document.querySelector('.footer'); const footer = document.querySelector('.footer');
const containerHeight = document.querySelector('header.header').offsetHeight + document.querySelector('.main').offsetHeight + footer.offsetHeight; const containerHeight = document.querySelector('.column').offsetHeight + document.querySelector('.main').offsetHeight + footer.offsetHeight;
footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight); footer.classList.toggle('footer-fixed', containerHeight <= window.innerHeight);
} }