From 66696080384311e02f398355365b6b5e89c9e7e4 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Thu, 29 Aug 2019 17:03:55 -0400 Subject: [PATCH 1/9] Make topbar sticky and set sticky cta header so it sticks below topbar --- js/index.js | 8 ++++++-- styles/components/_topbar.scss | 6 ++++++ templates/components/sticky_cta.html | 2 +- templates/navigation/topbar.html | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 5ea9ed13..5bb1a924 100644 --- a/js/index.js +++ b/js/index.js @@ -130,8 +130,12 @@ const app = new Vue({ directives: { sticky: { - inserted: el => { - stickybits(el) + inserted: (el, binding) => { + var customAttributes + if (binding.expression) { + customAttributes = JSON.parse(binding.expression) + } + stickybits(el, customAttributes) }, }, }, diff --git a/styles/components/_topbar.scss b/styles/components/_topbar.scss index a69ea78b..d2bff318 100644 --- a/styles/components/_topbar.scss +++ b/styles/components/_topbar.scss @@ -1,6 +1,12 @@ .topbar { background-color: $color-blue-darkest; border-bottom: 1px solid $color-black; + z-index: 16; + height: 48px; + + &.js-is-sticky { + width: 100%; + } &__navigation { display: flex; diff --git a/templates/components/sticky_cta.html b/templates/components/sticky_cta.html index b4c37d5a..d47e29cb 100644 --- a/templates/components/sticky_cta.html +++ b/templates/components/sticky_cta.html @@ -1,5 +1,5 @@ {% macro StickyCTA(text) -%} -
+

{{ text }}

diff --git a/templates/navigation/topbar.html b/templates/navigation/topbar.html index 0defde8a..4f44780c 100644 --- a/templates/navigation/topbar.html +++ b/templates/navigation/topbar.html @@ -1,6 +1,6 @@ {% from "components/icon.html" import Icon %} -
+