Make topbar sticky and set sticky cta header so it sticks below topbar

This commit is contained in:
leigh-mil 2019-08-29 17:03:55 -04:00
parent 2b11debe5d
commit 6669608038
4 changed files with 14 additions and 4 deletions

View File

@ -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)
},
},
},

View File

@ -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;

View File

@ -1,5 +1,5 @@
{% macro StickyCTA(text) -%}
<div class="sticky-cta" v-sticky="{ stickyTop: 2 }">
<div class="sticky-cta" v-sticky='{ "stickyBitStickyOffset": 48 }'>
<div class="sticky-cta-container">
<div class="sticky-cta-text">
<h3>{{ text }}</h3>

View File

@ -1,6 +1,6 @@
{% from "components/icon.html" import Icon %}
<header class="topbar">
<header class="topbar" v-sticky>
<nav class="topbar__navigation">
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home">
{{ Icon('shield', classes='topbar__link-icon') }}