From 30cf46c2c397004dddb2c3837bb1a88e50b6347d Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Wed, 28 Feb 2018 15:48:01 +0100
Subject: [PATCH] [web] Some link styling.

---
 web/layouts/partials/header.html | 11 +++++++----
 web/src/styles.css               | 18 +++++++++++++++++-
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/web/layouts/partials/header.html b/web/layouts/partials/header.html
index 2327d58b67f..b910547eb79 100644
--- a/web/layouts/partials/header.html
+++ b/web/layouts/partials/header.html
@@ -26,22 +26,25 @@
 <body class="font-sans">
   <header class="bg-light">
     <div class="container mx-auto">
-      <div class="flex border-b py-4">
+      <nav class="flex border-b py-4">
         <div class="w-1/4">
           <a href="/" class="font-serif-caps">{{ .Site.Title }}</a>
         </div>
         {{ $currentPage := . }}
+        {{ $segments := split .RelPermalink "/" }}
+        {{ $section := index $segments 1 }}
         <div class="w-1/2 flex justify-center">
           {{ range .Site.Menus.main }}
-          <a href="{{ .URL }}" class="mr-8{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}">{{ .Name }}</a>
+          {{ $url_trimmed := trim .URL "/" }}
+          <a href="{{ .URL }}" class="mr-8{{if (eq $section $url_trimmed) }} active{{end}}">{{ .Name }}</a>
           {{ end }}
         </div>
         <div class="w-1/4">
           {{ partial "site-search.html" . }}
         </div>
-      </div>
+      </nav>
       {{ if .Site.Params.alert }}
-      <div class="text-sm flex justify-center m-2 p-2 bg-blue-lightest text-blue-darker rounded">
+      <div class="text-sm flex justify-center my-2 p-2 bg-blue-lightest text-blue-darker border-l-4 border-blue">
         <i class="fas fa-exclamation-triangle"></i>&nbsp;
         <span class="lh-title ml3">{{ .Site.Params.alert | safeHTML }}</span>
       </div>
diff --git a/web/src/styles.css b/web/src/styles.css
index 7d502f5f602..c1c000b7f23 100644
--- a/web/src/styles.css
+++ b/web/src/styles.css
@@ -4,14 +4,25 @@
 @import url('https://fonts.googleapis.com/css?family=Spectral+SC');
 @import url('https://fonts.googleapis.com/css?family=Roboto:400,400i,700');
 
+/* -- Links -- */
 a {
   @apply .text-grey-darkest;
-  text-decoration: none;
+  @apply .no-underline;
+}
+a:hover {
+  @apply .underline;
 }
 a.active {
   @apply .text-orange;
 }
 
+nav a.active {
+  @apply text-grey-darkest;
+  @apply .border-b-2;
+  @apply .border-orange;
+}
+
+/* -- Typography -- */
 h1, h2, h3, h4, h5, h6 {
   @apply .font-serif;
   @apply .pt-2;
@@ -26,6 +37,8 @@ p, ul, pre {
   @apply .mb-4;
 }
 
+/* -- Misc -- */
+
 hr {
   @apply .border;
 }
@@ -47,10 +60,13 @@ hr {
   @apply .px-4;
   @apply .py-1;
   @apply .mb-4;
+  @apply .border-l-4;
+  @apply .border-orange;
 }
 
 .note h3 {
   @apply .text-orange;
+  @apply .mb-2;
 }
 
 /* -------------------------------- Algolia---------------------------------- */
-- 
GitLab