From 3b0a8db9f0e1b0e0f83888fe6ae1def71bd4794e Mon Sep 17 00:00:00 2001 From: Sarah German Date: Wed, 2 Aug 2023 16:46:30 -0500 Subject: Refactor spacing styles around the header --- content/assets/stylesheets/_landing.scss | 31 +++++++++++++--------- content/assets/stylesheets/_sidebar.scss | 6 ++--- content/assets/stylesheets/_typography.scss | 4 --- content/assets/stylesheets/stylesheet.scss | 26 +++++++----------- content/assets/stylesheets/toc.scss | 6 ++--- .../default/components/table_of_contents.vue | 4 +-- content/frontend/default/default.js | 15 ----------- content/index.erb | 10 +++---- layouts/banner.html | 2 +- layouts/default.html | 8 +++--- layouts/header.html | 4 +-- layouts/search.html | 4 +-- .../__snapshots__/table_of_contents_spec.js.snap | 4 +-- 13 files changed, 51 insertions(+), 73 deletions(-) diff --git a/content/assets/stylesheets/_landing.scss b/content/assets/stylesheets/_landing.scss index 5cad4685..916de307 100644 --- a/content/assets/stylesheets/_landing.scss +++ b/content/assets/stylesheets/_landing.scss @@ -16,6 +16,11 @@ } } + // banner + .admonition-wrapper { + margin-top: -1.5rem; + } + // cards .card { box-shadow: 0 0.5rem 1.5rem -0.75rem $landing-gl-blue-1000; @@ -55,7 +60,7 @@ background-image: url('/assets/images/hero-bg.svg'); background-repeat: no-repeat; background-attachment: inherit; - background-position: 50% 4%; + background-position: 50% 0.85rem; @media (max-width: $bp-sm) { background-image: url('/assets/images/hero-bg-mobile.svg'); @@ -125,17 +130,19 @@ } .oval { - border-radius: 50%; - position: absolute; - left: 0; - right: 0; - margin: auto; - width: 43.188rem; - height: 29rem; - background: $landing-gl-purple-50; - mix-blend-mode: multiply; - opacity: 0.24; - filter: blur(10.25rem); + @media (min-width: $bp-md) { + border-radius: 50%; + position: absolute; + left: 0; + right: 0; + margin: auto; + width: 43.188rem; + height: 29rem; + background: $landing-gl-purple-50; + mix-blend-mode: multiply; + opacity: 0.24; + filter: blur(10.25rem); + } } .topic { diff --git a/content/assets/stylesheets/_sidebar.scss b/content/assets/stylesheets/_sidebar.scss index 7a081549..ad05e8f5 100644 --- a/content/assets/stylesheets/_sidebar.scss +++ b/content/assets/stylesheets/_sidebar.scss @@ -3,8 +3,6 @@ .global-nav { width: 100%; height: 100%; - top: 0; - left: 0; overflow: auto; visibility: hidden; .global-nav-cat.active { @@ -13,7 +11,7 @@ } } .global-nav-content { - margin-top: 60px; + margin-top: 1rem; margin-bottom: 70px; } a { @@ -193,8 +191,10 @@ } @media (min-width: $bp-xl) { + .mobile-toggle-wrapper, .mobile-nav-toggle { display: none; border-bottom: 0; + margin: 0; } } diff --git a/content/assets/stylesheets/_typography.scss b/content/assets/stylesheets/_typography.scss index fb47a238..7a7fc7c4 100644 --- a/content/assets/stylesheets/_typography.scss +++ b/content/assets/stylesheets/_typography.scss @@ -418,10 +418,6 @@ font-size: 2rem; line-height: 1; margin-bottom: 1.5rem; - margin-top: -3.3rem; - padding-top: 6.6rem; - z-index: 0; - position: relative; } @media screen and (min-width: $bp-sm) { h1 { diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss index c8453090..751c5b18 100644 --- a/content/assets/stylesheets/stylesheet.scss +++ b/content/assets/stylesheets/stylesheet.scss @@ -10,7 +10,7 @@ @import 'typography'; body { - overflow-x: hidden; + overscroll-behavior: none; > .wrapper { min-height: 100vh; @media (max-width: $bp-md) { @@ -20,6 +20,10 @@ body { } } +:target { + scroll-margin-top: $header-height + 1rem; +} + main { min-height: 52vh; } @@ -79,7 +83,7 @@ ol { flex-direction: column; position: fixed; width: 50px; - top: 0; + top: $header-height; height: 100%; transition: all 0.3s; border-right: 1px solid $gds-gray-200; @@ -110,6 +114,8 @@ ol { border-radius: 0; box-shadow: none; justify-content: left; + position: relative; + top: calc($header-height * -1); .label { display: none; } @@ -237,11 +243,11 @@ ol { // Main header CSS .navbar { - min-height: $header-height; background-color: $header-background-color; .navbar-brand { font-size: 1rem; + min-height: $header-height; } .navbar-nav { @@ -502,20 +508,6 @@ p.result-snippet { background-color: $header-free-trial-button-color !important; } -h2[id]::before, -h3[id]::before, -h4[id]::before, -h5[id]::before, -h6[id]::before { - display: block; - content: ' '; - margin-top: -4.688rem; - height: 4.688rem; - visibility: hidden; - position: relative; - z-index: 0; -} - // Embedded video .video-container { width: 35rem; diff --git a/content/assets/stylesheets/toc.scss b/content/assets/stylesheets/toc.scss index e221476b..8cab2f06 100644 --- a/content/assets/stylesheets/toc.scss +++ b/content/assets/stylesheets/toc.scss @@ -55,7 +55,7 @@ $nav-link-font-size: 0.875rem; // ToC before JavaScript loads #markdown-toc { position: absolute; - top: 0; + top: $header-height; right: 0; padding-top: calc(4.75rem + 1.375rem * 1.125); padding-left: 3rem; @@ -88,7 +88,7 @@ $nav-link-font-size: 0.875rem; } .markdown-toc { - top: 0; + top: $header-height; @media(min-width: $bp-xl) { padding-left: 1rem; @@ -98,7 +98,7 @@ $nav-link-font-size: 0.875rem; } @media(max-width: calc($bp-xl - 1px)) { - margin-top: 7rem; + margin-top: 6rem; } } diff --git a/content/frontend/default/components/table_of_contents.vue b/content/frontend/default/components/table_of_contents.vue index 7ffbc570..4eaaa3b8 100644 --- a/content/frontend/default/components/table_of_contents.vue +++ b/content/frontend/default/components/table_of_contents.vue @@ -42,9 +42,9 @@ export default { };