From cd660e6ab2ad0fba350ffedf16d35611532786d9 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Mon, 12 Aug 2024 20:26:34 +0200 Subject: [PATCH] Responsive Design Rework --- quartz/components/styles/graph.scss | 2 +- quartz/components/styles/search.scss | 2 +- quartz/styles/base.scss | 71 ++++++++++++++++++++-------- quartz/styles/variables.scss | 4 +- 4 files changed, 55 insertions(+), 24 deletions(-) diff --git a/quartz/components/styles/graph.scss b/quartz/components/styles/graph.scss index 3deaa1feb..5c18bdfb2 100644 --- a/quartz/components/styles/graph.scss +++ b/quartz/components/styles/graph.scss @@ -62,7 +62,7 @@ height: 60vh; width: 50vw; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $desktopBreakpoint) { width: 90%; } } diff --git a/quartz/components/styles/search.scss b/quartz/components/styles/search.scss index cc2daca3b..b6e63fe74 100644 --- a/quartz/components/styles/search.scss +++ b/quartz/components/styles/search.scss @@ -62,7 +62,7 @@ margin-left: auto; margin-right: auto; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $desktopBreakpoint) { width: 90%; } diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 3b3ead7c3..dfca5d709 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -109,22 +109,34 @@ a { .desktop-only { display: initial; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $mobileBreakpoint) { display: none; } + &.toc { + @media all and (max-width: $tabletBreakpoint) { + display: none; + } + } } .mobile-only { display: none; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $mobileBreakpoint) { display: initial; } + &.toc { + @media all and (max-width: $tabletBreakpoint) { + display: initial; + } + } } .page { - @media all and (max-width: $fullPageWidth) { - margin: 0 auto; + @media all and (max-width: $desktopBreakpoint) { padding: 0 1rem; + } + @media all and (max-width: $mobileBreakpoint) { + margin: 0 auto; max-width: $pageWidth; } @@ -157,7 +169,7 @@ a { & > #quartz-body { width: 100%; display: flex; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $desktopBreakpoint) { flex-direction: column; } @@ -172,7 +184,16 @@ a { box-sizing: border-box; padding: 0 4rem; position: fixed; - @media all and (max-width: $fullPageWidth) { + } + + & .sidebar.left { + left: 0; + @media all and (min-width: $desktopBreakpoint) { + left: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth); + } + @media all and (max-width: $mobileBreakpoint) { + gap: 0; + align-items: center; position: initial; flex-direction: row; padding: 0; @@ -181,19 +202,21 @@ a { } } - & .sidebar.left { - left: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth); - @media all and (max-width: $fullPageWidth) { - gap: 0; - align-items: center; - } - } - & .sidebar.right { right: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth); flex-wrap: wrap; - & > * { - @media all and (max-width: $fullPageWidth) { + @media all and (min-width: $mobileBreakpoint) { + margin-left: $sidePanelWidth; + margin-right: 0; + } + @media all and (max-width: $desktopBreakpoint) { + position: initial; + flex-direction: row; + padding: 0; + width: initial; + margin-top: 2rem; + display: flex; + & > * { flex: 1; min-width: 140px; } @@ -206,14 +229,17 @@ a { width: $pageWidth; margin-top: 1rem; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $tabletBreakpoint) { width: initial; } } & .page-header { margin: $topSpacing auto 0 auto; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $desktopBreakpoint) { + margin: $topSpacing 0 0 0; + } + @media all and (max-width: $tabletBreakpoint) { margin-top: 2rem; } } @@ -223,10 +249,15 @@ a { margin-left: auto; margin-right: auto; width: $pageWidth; - @media all and (max-width: $fullPageWidth) { + @media all and (max-width: $desktopBreakpoint) { + width: calc(100% - $sidePanelWidth); + right: 0; + margin-left: $sidePanelWidth; + margin-right: 0; + } + @media all and (max-width: $mobileBreakpoint) { width: initial; margin-left: 0; - margin-right: 0; } } } diff --git a/quartz/styles/variables.scss b/quartz/styles/variables.scss index e45cc9158..03cf68f78 100644 --- a/quartz/styles/variables.scss +++ b/quartz/styles/variables.scss @@ -1,9 +1,9 @@ $pageWidth: 750px; -$mobileBreakpoint: 600px; +$mobileBreakpoint: 750px; $tabletBreakpoint: 1000px; +$desktopBreakpoint: 1500px; $sidePanelWidth: 380px; $topSpacing: 6rem; -$fullPageWidth: $pageWidth + 2 * $sidePanelWidth; $boldWeight: 700; $semiBoldWeight: 600; $normalWeight: 400;