提交 2583d02b 编写于 作者: C codecalm

topnav refactoring

上级 0abf8166
{% assign fixed = page.topnav-fixed %}
{% assign fixed = true %}
<nav id="nav-main-menu" class="navbar navbar-border fixed-top navbar-expand-lg {% if page.topmenu-dark %}navbar-dark bg-dark text-white{% else %}navbar-light bg-white{% endif %}{% if fixed %} fixed-top{% endif %}">
<div class="container{% if include.fluid %}-fluid{% endif %}">
<div class="collapse navbar-collapse">
{% include layout/menu.html top=true %}
{% include layout/navbar-search.html %}
</div>
</div>
</nav>
\ No newline at end of file
......@@ -3,12 +3,12 @@
{% assign dark = page.topnav-dark %}
{% assign fixed = page.topnav-fixed %}
{% assign fixed = true %}
{% assign breakpoint = 'lg' %}
<header class="navbar navbar-border {% if dark %}navbar-dark bg-dark text-white{% else %}navbar-light bg-white{% endif %}{% if fixed %} fixed-top{% endif %}">
<div class="container{% if include.topnav-fluid %}-fluid{% endif %}">
<button class="navbar-toggler mr-auto hide-sidebar-visible" type="button" data-toggle="collapse" data-target="#nav-main-menu" aria-expanded="false">
<button class="navbar-toggler mr-auto {% if page.sidebar %}hide-sidebar-visible{% else %}d-{{ breakpoint }}-none{% endif %}" type="button" data-toggle="collapse" data-target="#nav-main-menu" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
......@@ -63,4 +63,15 @@
</div>
</header>
{% unless page.sidebar %}
<nav id="nav-main-menu" class="navbar navbar-border {% if page.topmenu-dark %}navbar-dark bg-dark text-white{% else %}navbar-light bg-white{% endif %}{% if fixed %} fixed-top{% endif %}">
<div class="container{% if include.fluid %}-fluid{% endif %}">
<div class="collapse navbar-collapse">
{% include layout/menu.html top=true %}
{% include layout/navbar-search.html %}
</div>
</div>
</nav>
{% endunless %}
......@@ -10,10 +10,6 @@ layout: base
<div class="content">
{% include layout/topnav.html %}
{% unless page.sidebar %}
{% include layout/topmenu.html %}
{% endunless %}
<div class="content-page">
<main class="container{% if page.container-size %}-{{ page.container-size }}{% endif %} my-4 flex-fill">
{% include layout/page-title.html %}
......
......@@ -3,8 +3,6 @@ title: Dashboard
page-title: Dashboard
page-pretitle: Overview
page-title-actions: buttons
sidebar: true
sidebar-dark: true
menu: home
---
......
......@@ -9,20 +9,16 @@ Navbar
padding-top: $navbar-height;
}
+ .navbar:not(.fixed-top) {
margin-top: $navbar-height;
}
+ .navbar.fixed-top {
top: $navbar-height;
+ .content-page {
padding-top: $navbar-height * 2;
}
+ .navbar.fixed-top {
top: $navbar-height * 2;
+ .content-page {
padding-top: $navbar-height * 3;
}
}
}
}
}
......@@ -109,8 +105,8 @@ Navbar logo
}
.navbar-nav {
margin-right: -($navbar-padding-x);
margin-left: -($navbar-padding-x);
margin-right: -($navbar-nav-link-padding-x);
margin-left: -($navbar-nav-link-padding-x);
.nav-link {
padding-left: $navbar-nav-link-padding-x;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册