From 5b6ec6cc73c1ea65ce4d54050e4090573dc84e60 Mon Sep 17 00:00:00 2001 From: Paul Weidner Date: Fri, 25 Aug 2023 15:19:43 -0700 Subject: [PATCH 1/3] Decrease horizontal margins on pages --- modules/core/ui/theme/css/regions.css | 16 ++++++++++++++++ .../core/ui/theme/farm_ui_theme.libraries.yml | 4 ++++ modules/core/ui/theme/farm_ui_theme.module | 7 +++++++ 3 files changed, 27 insertions(+) create mode 100644 modules/core/ui/theme/css/regions.css diff --git a/modules/core/ui/theme/css/regions.css b/modules/core/ui/theme/css/regions.css new file mode 100644 index 000000000..31b941d91 --- /dev/null +++ b/modules/core/ui/theme/css/regions.css @@ -0,0 +1,16 @@ +/* Decrease the horizontal margin on medium to large screens. Gin uses xxl. */ +@media (min-width: 48em) { + .toolbar-tray-open:not(.toolbar-vertical) .layout-container, + body:not(.toolbar-tray-open) .layout-container { + margin-left: var(--gin-spacing-m) !important; + margin-right: var(--gin-spacing-m) !important; + } +} + +/* + Override gin style that moves user toolbar icon to the right. + With our narrower margins this overflows and adds a horizontal scroll bar. + */ +.toolbar-id--toolbar-icon-user { + margin-right: 0 !important; +} diff --git a/modules/core/ui/theme/farm_ui_theme.libraries.yml b/modules/core/ui/theme/farm_ui_theme.libraries.yml index 7f54ebf56..907ce8dfc 100644 --- a/modules/core/ui/theme/farm_ui_theme.libraries.yml +++ b/modules/core/ui/theme/farm_ui_theme.libraries.yml @@ -36,6 +36,10 @@ quick: css: theme: css/quick.css: { } +regions: + css: + theme: + css/regions.css: { } toolbar: css: theme: diff --git a/modules/core/ui/theme/farm_ui_theme.module b/modules/core/ui/theme/farm_ui_theme.module index 5d01d0da1..a09dfaf6e 100644 --- a/modules/core/ui/theme/farm_ui_theme.module +++ b/modules/core/ui/theme/farm_ui_theme.module @@ -109,6 +109,13 @@ function farm_ui_theme_preprocess_log__full(&$variables) { $variables['#attached']['library'][] = 'farm_ui_theme/layout'; } +/** + * Implements hook_preprocess_HOOK(). + */ +function farm_ui_theme_preprocess_page(&$variables) { + $variables['#attached']['library'][] = 'farm_ui_theme/regions'; +} + /** * Implements hook_preprocess_HOOK(). */ From a18e44cd8d5df96d2c05800db3da31e48c1960cb Mon Sep 17 00:00:00 2001 From: Paul Weidner Date: Fri, 25 Aug 2023 15:24:50 -0700 Subject: [PATCH 2/3] Decrease space at top of pages around help --- modules/core/ui/theme/css/help.css | 4 ++-- modules/core/ui/theme/css/regions.css | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/core/ui/theme/css/help.css b/modules/core/ui/theme/css/help.css index a62892b02..8bf645e16 100644 --- a/modules/core/ui/theme/css/help.css +++ b/modules/core/ui/theme/css/help.css @@ -1,3 +1,3 @@ -.help .block-help-block p { - margin-bottom: 1em; +.help .block-help-block p:not(:last-child) { + margin-bottom: var(--gin-spacing-xs); } diff --git a/modules/core/ui/theme/css/regions.css b/modules/core/ui/theme/css/regions.css index 31b941d91..81e44819c 100644 --- a/modules/core/ui/theme/css/regions.css +++ b/modules/core/ui/theme/css/regions.css @@ -14,3 +14,10 @@ .toolbar-id--toolbar-icon-user { margin-right: 0 !important; } + +/* Decrease top margin from elements below page title. */ +.layout-container .page-content > .help, +.layout-container .page-content > .region-highlighted, +.layout-container .page-content > .region-content { + margin-top: var(--gin-spacing-s); +} From a915d3b17436f36fe307b945931ab7166773950f Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Thu, 5 Oct 2023 10:41:01 -0400 Subject: [PATCH 3/3] Add CHANGELOG.md for #719. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 953bd99d1..4a30813ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Dashboard improvements #712](https://github.com/farmOS/farmOS/pull/712) - [Condense metrics UI #711](https://github.com/farmOS/farmOS/pull/711) - [Condense views table UI #713](https://github.com/farmOS/farmOS/pull/713) +- [Decrease horizontal and top margins on pages #719](https://github.com/farmOS/farmOS/pull/719) - [Misc quick form code and documentation improvements #703](https://github.com/farmOS/farmOS/pull/703) ### Deprecated