From 445abf0fff929073725bea8bce8cc6eee5466445 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Wed, 26 Apr 2017 16:01:08 -0400 Subject: [PATCH 1/2] Switch to Flexbox for main navigation --- umap/static/umap/nav.css | 49 ++++++++++++++++++ umap/static/umap/umap.css | 77 +---------------------------- umap/templates/base.html | 1 + umap/templates/umap/content.html | 4 +- umap/templates/umap/navigation.html | 22 +++------ 5 files changed, 61 insertions(+), 92 deletions(-) create mode 100644 umap/static/umap/nav.css diff --git a/umap/static/umap/nav.css b/umap/static/umap/nav.css new file mode 100644 index 00000000..dfbe6a18 --- /dev/null +++ b/umap/static/umap/nav.css @@ -0,0 +1,49 @@ +.umap-nav { + display: flex; + flex-direction: column; +} +.umap-nav a { + color: #3A4259; + padding: .4rem; +} +.umap-nav a:hover { + text-decoration: underline; +} +.umap-nav h1 { + margin-bottom: 0; +} +.umap-nav h1 a { + background-image: url("./img/logo.svg"); + background-position: left center; + background-repeat: no-repeat; + background-size: 60px auto; + line-height: 70px; + padding-left: 80px; + display: block; + font-size: 1.5rem; +} +.umap-nav ul { + text-align: center; +} +.umap-nav ul li { + line-height: 2.5rem; +} +.umap-nav .button, +.umap-nav .button:hover { + color: #fff; + text-decoration: none; + min-width: 150px; +} + +@media only screen and (min-width: 500px) { + .umap-nav ul li { + display: inline-block; + } +} +@media only screen and (min-width: 750px) { + .umap-nav { + flex-direction: row; + justify-content: space-between; + align-items: baseline; + } +} diff --git a/umap/static/umap/umap.css b/umap/static/umap/umap.css index 5f78d764..4f2f90f2 100644 --- a/umap/static/umap/umap.css +++ b/umap/static/umap/umap.css @@ -121,7 +121,8 @@ ul { clear: both; margin-left: auto; margin-right: auto; - margin-top: 40px; + margin-top: 0; + margin-bottom: 2rem; } .col { float: left; @@ -260,71 +261,6 @@ input:-moz-placeholder, :-moz-placeholder { header { margin: 14px 0; } -header nav { - min-height: 70px; - font-size: 0; - padding-top: 0; - max-width: 1200px; - margin-left: auto; - margin-right: auto; -} - -nav section, nav h1, nav ul, nav li, nav a { - display: inline-block; - font-size: 16px; - letter-spacing: -1px; - margin-bottom: 0; - font-weight: normal; -} - -nav ul li { - height: 100%; -} - -nav a { - display: inline-block; - height: 100%; - line-height: 70px; - padding: 0 14px; - margin: 0 7px 0 0; - color: #000; - text-align: center; -} - -nav .menu a:hover { - text-decoration: underline; -} - -nav h1 a { - background-image: url("./img/logo.svg"); - background-position: left center; - background-repeat: no-repeat; - background-size: 60px auto; - font-family: 'fira_sansbold'; - font-size: 30px; - font-weight: normal; - height: 70px; - padding-left: 80px; - text-align: left; - color: #3A4259; -} - -nav a.logout { - font-style: italic; -} - -nav li.has-button { - padding-top: 7px; - margin-bottom: 0; -} -nav li.has-button .button { - margin-bottom: 0; -} - -nav .branding ul, nav .branding li, -nav .branding a, nav .branding h1 { - width: 100%; -} footer { height: 140px; @@ -604,12 +540,6 @@ body.content #storage-ui-container { .thide { display: none; } - nav .branding h1 { - text-align: center; - } - nav .branding h1 a { - width: auto; - } } @media only screen and (max-width: 639px) { .mwide { @@ -628,7 +558,4 @@ body.content #storage-ui-container { .mhide { display: none; } - header nav ul { - display: block; - } } diff --git a/umap/templates/base.html b/umap/templates/base.html index 2bc062d3..f6f1be68 100644 --- a/umap/templates/base.html +++ b/umap/templates/base.html @@ -8,6 +8,7 @@ + {% endcompress css %} diff --git a/umap/templates/umap/content.html b/umap/templates/umap/content.html index d5189d46..8435d7fd 100644 --- a/umap/templates/umap/content.html +++ b/umap/templates/umap/content.html @@ -12,8 +12,8 @@ {% endblock %} {% block header %} -
- {% include 'umap/navigation.html' %} +
+ {% include 'umap/navigation.html' with title=SITE_NAME %}
{% endblock %} diff --git a/umap/templates/umap/navigation.html b/umap/templates/umap/navigation.html index 37152630..424f9f68 100644 --- a/umap/templates/umap/navigation.html +++ b/umap/templates/umap/navigation.html @@ -1,12 +1,10 @@ {% load i18n %} -