From cac9d67e55baecf3b4b0c71e2e8fa249e29f0e05 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 8 Jan 2025 15:24:59 +0100 Subject: [PATCH] Adjust layout spacings --- .../src/components/Layout/Layout.module.css | 15 +- .../PageHeading/PageHeading.module.css | 8 +- frontend/src/routes/_account.lazy.tsx | 20 ++- .../account/__snapshots__/index.test.tsx.snap | 162 +++++++++--------- 4 files changed, 109 insertions(+), 96 deletions(-) diff --git a/frontend/src/components/Layout/Layout.module.css b/frontend/src/components/Layout/Layout.module.css index 79347e4db..04f36211e 100644 --- a/frontend/src/components/Layout/Layout.module.css +++ b/frontend/src/components/Layout/Layout.module.css @@ -6,33 +6,34 @@ */ .layout-container { + --target-width: 378px; + --inline-padding: var(--cpd-space-4x); box-sizing: border-box; display: flex; flex-direction: column; - max-width: calc(378px + var(--cpd-space-5x) * 2); + max-width: calc(var(--target-width) + var(--inline-padding) * 2); /* Fallback for browsers that do not support 100svh */ min-height: 100vh; min-height: 100svh; margin: 0 auto; - padding-inline: var(--cpd-space-5x); - padding-block: var(--cpd-space-12x); + padding-inline: var(--inline-padding); + padding-block: var(--cpd-space-8x); gap: var(--cpd-space-8x); &.consent { - max-width: calc(460px + var(--cpd-space-5x) * 2); + --target-width: 460px; } &.wide { - max-width: calc(520px + var(--cpd-space-5x) * 2); + --target-width: 520px; } } @media screen and (min-width: 768px) { .layout-container { - padding-block-start: var(--cpd-space-20x); - padding-block-end: var(--cpd-space-10x); + padding-block: var(--cpd-space-12x); } } diff --git a/frontend/src/components/PageHeading/PageHeading.module.css b/frontend/src/components/PageHeading/PageHeading.module.css index 3ce16f96b..ade452a86 100644 --- a/frontend/src/components/PageHeading/PageHeading.module.css +++ b/frontend/src/components/PageHeading/PageHeading.module.css @@ -10,7 +10,7 @@ flex-direction: column; gap: var(--cpd-space-4x); - /* Layout already has 6x padding, and we need 10x */ + /* Layout already has 8x/12x padding, and we need 12x/20x */ margin-block-start: var(--cpd-space-4x); & .icon { @@ -74,3 +74,9 @@ } } } + +@media screen and (min-width: 768px) { + .layout-container { + margin-block-start: var(--cpd-space-8x); + } +} diff --git a/frontend/src/routes/_account.lazy.tsx b/frontend/src/routes/_account.lazy.tsx index 698755cc4..d5390874d 100644 --- a/frontend/src/routes/_account.lazy.tsx +++ b/frontend/src/routes/_account.lazy.tsx @@ -33,23 +33,25 @@ function Account(): React.ReactElement { return ( -
-
- +
+
+ {t("frontend.account.title")}
- +
+ - + - - {t("frontend.nav.settings")} - {t("frontend.nav.devices")} - + + {t("frontend.nav.settings")} + {t("frontend.nav.devices")} + +
diff --git a/frontend/tests/routes/account/__snapshots__/index.test.tsx.snap b/frontend/tests/routes/account/__snapshots__/index.test.tsx.snap index 0350f7ff9..7bbdb9738 100644 --- a/frontend/tests/routes/account/__snapshots__/index.test.tsx.snap +++ b/frontend/tests/routes/account/__snapshots__/index.test.tsx.snap @@ -298,13 +298,13 @@ exports[`Account home page > renders the page 1`] = ` class="_layoutContainer_0c8bf9 _wide_0c8bf9" >

Your account

@@ -336,94 +336,98 @@ exports[`Account home page > renders the page 1`] = `
- - A -
- -

- @alice:example.com -

-
- -
-
+ +
+ + + Settings + + +
  • + + Devices + +
  • + + +