From ee9af871b756733bd9586a24c2c025cb0334fa7d Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Wed, 2 Nov 2022 09:23:08 +0100 Subject: [PATCH] Use custom scrollbar in stats screen, use grid layout and tweak CSS (#2154) * Include base styles in graphs-base.scss This includes the custom scrollbar styles, which were missing on the stats page. * Set responsive grid layout on GraphsPage, use TitledContainer component + use global button style, tweak input appearance and other small changes * Improve margins on GraphsPage --- sass/base.scss | 15 +++++++ .../TitledContainer.svelte | 7 +++- ts/deck-options/Addons.svelte | 2 +- ts/deck-options/AdvancedOptions.svelte | 2 +- ts/deck-options/AudioOptions.svelte | 2 +- ts/deck-options/BuryOptions.svelte | 2 +- ts/deck-options/DailyLimits.svelte | 2 +- ts/deck-options/DisplayOrder.svelte | 2 +- ts/deck-options/LapseOptions.svelte | 2 +- ts/deck-options/NewOptions.svelte | 2 +- ts/deck-options/TimerOptions.svelte | 2 +- ts/deck-options/index.ts | 2 +- ts/graphs/BUILD.bazel | 3 ++ ts/graphs/Graph.svelte | 30 +++++-------- ts/graphs/GraphsPage.svelte | 42 ++++++++++++------- ts/graphs/RangeBox.svelte | 7 ++-- ts/graphs/graphs-base.scss | 10 ++--- ts/graphs/tsconfig.json | 6 ++- 18 files changed, 85 insertions(+), 55 deletions(-) rename ts/{deck-options => components}/TitledContainer.svelte (89%) diff --git a/sass/base.scss b/sass/base.scss index f5cbf4275..9001bcdfa 100644 --- a/sass/base.scss +++ b/sass/base.scss @@ -55,6 +55,7 @@ button { /* override transition for instant hover response */ transition: color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important; border-radius: prop(border-radius); + @include button.base; } pre, @@ -113,3 +114,17 @@ select { color: color(fg); } } + +label, +input[type="radio"], +input[type="checkbox"] { + cursor: pointer; +} +input[type="text"] { + border-radius: prop(border-radius); + outline: none; + border: 1px solid color(border); + &:focus { + border-color: color(border-focus); + } +} diff --git a/ts/deck-options/TitledContainer.svelte b/ts/components/TitledContainer.svelte similarity index 89% rename from ts/deck-options/TitledContainer.svelte rename to ts/components/TitledContainer.svelte index 00e189a35..68eaa7edf 100644 --- a/ts/deck-options/TitledContainer.svelte +++ b/ts/components/TitledContainer.svelte @@ -5,11 +5,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-
-

{title}

- - {#if subtitle} -
{subtitle}
- {/if} - - -
+ +
+ {#if subtitle} +
{subtitle}
+ {/if} + +
+
diff --git a/ts/graphs/RangeBox.svelte b/ts/graphs/RangeBox.svelte index b70b8c1a6..c07760312 100644 --- a/ts/graphs/RangeBox.svelte +++ b/ts/graphs/RangeBox.svelte @@ -113,13 +113,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html diff --git a/ts/graphs/graphs-base.scss b/ts/graphs/graphs-base.scss index ce9379e02..a6756ba7a 100644 --- a/ts/graphs/graphs-base.scss +++ b/ts/graphs/graphs-base.scss @@ -1,12 +1,10 @@ @use "root-vars"; -@use "sass/button-mixins" as button; +@import "sass/base"; -label, -input[type="radio"], -input[type="checkbox"] { - cursor: pointer; +body { + padding: 0 1em 1em 1em; } button { - @include button.base; + margin-bottom: 5px; } diff --git a/ts/graphs/tsconfig.json b/ts/graphs/tsconfig.json index 6ef6ea47c..550aecf3c 100644 --- a/ts/graphs/tsconfig.json +++ b/ts/graphs/tsconfig.json @@ -1,5 +1,9 @@ { "extends": "../tsconfig.json", "include": ["*"], - "references": [{ "path": "../lib" }, { "path": "../sveltelib" }] + "references": [ + { "path": "../lib" }, + { "path": "../components" }, + { "path": "../sveltelib" } + ] }