Add a few style-changes

This commit is contained in:
Manuel Thalmann 2019-11-22 13:12:55 +00:00
parent 1543603447
commit 5bb5999cde
4 changed files with 83 additions and 29 deletions

View file

@ -5,42 +5,56 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<% base_tag %> <% base_tag %>
$MetaTags() $MetaTags(false)
<title><% if $Title %>$Title <% end_if %>$SiteConfig.Title</title>
<% require themedCSS("mantra") %> <% require themedCSS("mantra") %>
<% require themedJavascript("main") %> <% require themedJavascript("main") %>
</head> </head>
<body class="d-flex flex-column h-100"> <body class="d-flex flex-column h-100">
<% if $Menu(1) %> <nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark">
<div class="col-1"> <a class="navbar-brand" href="$AbsoluteBaseURL">
<nav> <div class="navbar-title">$SiteConfig.Title</div>
<div class="active"> <div class="navbar-tagline">$SiteConfig.Tagline</div>
<a> </a>
$Title <% if $Menu(1) %>
</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
<ul class="nav bd-sidenav"> <span class="navbar-toggler-icon"></span>
<% loop $Menu(1) %> </button>
<li class="$LinkingMode"> <div class="collapse navbar-collapse" id="mainNav">
<a href="$Link"> <ul class="navbar-nav">
<% loop $Menu(1) %>
<% if $Children %>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle<% if $isCurrent || $isSection %> active <% end_if %>" href="#" id="mainNav_$URLSegment" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
$MenuTitle $MenuTitle
</a> </a>
<div class="dropdown-menu" aria-labelledby="mainNav_$URLSegment">
<a class="dropdown-item<% if $isCurrent %> active <% end_if %>" href="$Link">
$MenuTitle<% if $isCurrent %><span class="sr-only"> (current)</span><% end_if %>
</a>
<div class="dropdown-divider"></div>
<% loop $Children %>
<a class="dropdown-item<% if $isCurrent %> active <% end_if %>" href="$Link">
$MenuTitle
</a>
<% end_loop %>
</div>
</li> </li>
<% end_loop %> <% else %>
</ul> <li class="nav-item<% if $isCurrent %> active<% end_if %>">
</div> <a class="nav-link" href="$Link">
</nav> $MenuTitle<% if $isCurrent %><span class="sr-only"> (current)</span><% end_if %>
</div> </a>
<% end_if %> </li>
<main role="main" class="col-11 flex-shrink-0"> <% end_if %>
<div class="container"> <% end_loop %>
<% loop $Menu(1) %> </ul>
<li><a class="$LinkingMode" href="$Link" title="Go to the $Title page">$MenuTitle</a></li> </div>
<% end_loop %> <% end_if %>
<h1 class="display-4"> </nav>
$MenuTitle <main role="main" class="col-11 flex-shrink-0" style="padding-top: 4.5rem">
</h1> $Content
$Content $Form
$Form
</div>
</main> </main>
</body> </body>
</html> </html>

37
src/Theme/_nav.scss Normal file
View file

@ -0,0 +1,37 @@
.navbar {
.navbar-nav {
.nav-link {
position: relative;
&::before {
content: ' ';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin-top: -($navbar-padding-x / 2);
margin-bottom: -($navbar-padding-x / 2);
}
}
.active > .nav-link, .nav-link.active {
&::before {
background: rgba(255, 255, 255, 0.1);
}
}
}
}
.navbar-brand {
.navbar-title {
@extend .d-inline-block;
}
.navbar-tagline {
@extend .text-muted;
@extend .d-none;
@extend .d-lg-inline-block;
font-size: 0.5em;
}
}

View file

@ -0,0 +1 @@
$tagline-font-size: $small-font-size / 2;

View file

@ -1 +1,3 @@
@import "~bootstrap/scss/bootstrap"; @import "~bootstrap/scss/bootstrap";
@import "variables";
@import "nav";