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 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 new file mode 100644 index 000000000..81e44819c --- /dev/null +++ b/modules/core/ui/theme/css/regions.css @@ -0,0 +1,23 @@ +/* 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; +} + +/* 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); +} 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(). */