diff --git a/_includes/header.html b/_includes/header.html index 3897da5..98358e5 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -10,6 +10,16 @@ {% endif %} + + + + + + + + + + diff --git a/_sass/_header.scss b/_sass/_header.scss index 22b46a9..c1cdcb8 100644 --- a/_sass/_header.scss +++ b/_sass/_header.scss @@ -18,6 +18,15 @@ .site-nav { float: right; line-height: $nav-height; + + .nav-trigger { + display: none; + } + + .menu-icon { + display: none; + } + .page-link{ line-height: $line-height; // Gaps between nav items, but not on the first one @@ -25,19 +34,59 @@ margin-left: 10px; } } - // @include media-query($on-palm) { - // position: fixed; - // top: 0px; - // right: 10px; - // text-align: right; - // &:hover .trigger { - // display: block; - // padding-bottom: 5px; - // } - // .page-link { - // display: line; - // } - // } + // added for hamburger + @include media-query($on-palm) { + position: absolute; + top: 9px; + right: $horizontal-spacing-unit / 2; + background-color: $background-color; + border: 1px solid $grey-color-light; + border-radius: 5px; + text-align: right; + + label[for="nav-trigger"] { + display: block; + float: right; + width: 36px; + height: 36px; + z-index: 2; + cursor: pointer; + } + + .menu-icon { + display: block; + float: right; + width: 36px; + height: 26px; + line-height: 0; + padding-top: 10px; + text-align: center; + + > svg path { + fill: $grey-color-dark; + } + } + + input ~ .trigger { + clear: both; + display: none; + } + + input:checked ~ .trigger { + display: block; + padding-bottom: 5px; + } + + .page-link { + display: block; + padding: 5px 10px; + + &:not(:last-child) { + margin-right: 0; + } + margin-left: 10px; + } + } } .header-bar{ diff --git a/_sass/_media-queries.scss b/_sass/_media-queries.scss index fae069b..6f3ba3c 100644 --- a/_sass/_media-queries.scss +++ b/_sass/_media-queries.scss @@ -1,7 +1,13 @@ +@mixin media-query($device) { + @media screen and (max-width: $device) { + @content; + } +} + @media screen and (min-width: $viewport-small) { - html { - font-size: 16px; - } + html { + font-size: 16px; + } h1, .h1 { diff --git a/_sass/_variables.scss b/_sass/_variables.scss index 47891fe..a1c99f5 100644 --- a/_sass/_variables.scss +++ b/_sass/_variables.scss @@ -30,6 +30,7 @@ $abbr-border-bottom: 1px black dotted; // Page width $measure-width: 42rem !default; + // Viewport widths $viewport-small: 32em; $viewport-medium: 48em; @@ -158,3 +159,6 @@ $img_spacing: 5px; $img-height: 275px; $caption-font-size: 12px; $caption-color: #aaa; + +/* add on-palm to be consistent with other jekyll theme media queries */ +$on-palm: 600px !default; diff --git a/assets/css/main.scss b/assets/css/main.scss index 39dad4b..b922529 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -5,7 +5,7 @@ @import 'variables'; - +@import 'media-queries'; @import 'basscss'; @import 'base'; @@ -28,7 +28,7 @@ @import 'gists'; @import 'links'; @import 'measure'; -@import 'media-queries'; + @import 'social-icons'; @import 'tables'; @import 'typography';