From 1d8a0d1c216ab0b3c9c8bc3bfc9925a356cd0c36 Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Tue, 8 Jun 2021 21:08:29 -0400 Subject: [PATCH] Add some space between help text paragraphs via CSS. --- modules/ui/location/farm_ui_location.module | 2 -- modules/ui/theme/css/help.css | 3 +++ modules/ui/theme/farm_ui_theme.libraries.yml | 4 ++++ modules/ui/theme/farm_ui_theme.module | 9 +++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 modules/ui/theme/css/help.css diff --git a/modules/ui/location/farm_ui_location.module b/modules/ui/location/farm_ui_location.module index 262aded9..68a288dc 100644 --- a/modules/ui/location/farm_ui_location.module +++ b/modules/ui/location/farm_ui_location.module @@ -16,7 +16,6 @@ function farm_ui_location_help($route_name, RouteMatchInterface $route_match) { // Locations overview help text. if ($route_name == 'farm.locations') { $output .= '

' . t('Locations represent places of interest. They are assets, and assets can be moved to them. Logs can reference them.') . '

'; - $output .= '

 

'; $output .= '

' . t('Locations can be organized into a hierarchy with parent relationships.') . '

'; } @@ -27,7 +26,6 @@ function farm_ui_location_help($route_name, RouteMatchInterface $route_match) { // Drag and drop help text. if (in_array($route_name, ['farm.locations', 'farm.asset.locations'])) { - $output .= '

 

'; $output .= '

' . t('To change the hierarchy, either click on individual assets and edit their parent, or click %toggle_button below to enable drag and drop editing on this page. The %save_button button will save changes, and %reset_button will reset them.', ['%toggle_button' => t('Toggle drag and drop'), '%save_button' => t('Save'), '%reset_button' => t('Reset')]) . '

'; } diff --git a/modules/ui/theme/css/help.css b/modules/ui/theme/css/help.css new file mode 100644 index 00000000..a62892b0 --- /dev/null +++ b/modules/ui/theme/css/help.css @@ -0,0 +1,3 @@ +.help .block-help-block p { + margin-bottom: 1em; +} diff --git a/modules/ui/theme/farm_ui_theme.libraries.yml b/modules/ui/theme/farm_ui_theme.libraries.yml index e05b1713..b95429e4 100644 --- a/modules/ui/theme/farm_ui_theme.libraries.yml +++ b/modules/ui/theme/farm_ui_theme.libraries.yml @@ -6,6 +6,10 @@ footer: css: theme: css/footer.css: { } +help: + css: + theme: + css/help.css: { } map: css: theme: diff --git a/modules/ui/theme/farm_ui_theme.module b/modules/ui/theme/farm_ui_theme.module index 89d0eb35..99cf87eb 100644 --- a/modules/ui/theme/farm_ui_theme.module +++ b/modules/ui/theme/farm_ui_theme.module @@ -16,6 +16,15 @@ function farm_ui_theme_element_info_alter(array &$info) { } } +/** + * Implements hook_preprocess_HOOK(). + */ +function farm_ui_theme_preprocess_block(&$variables) { + if ($variables['plugin_id'] == 'help_block') { + $variables['#attached']['library'][] = 'farm_ui_theme/help'; + } +} + /** * Implements hook_preprocess_HOOK(). */