- Issue created by @flyke
- 🇧🇪Belgium flyke
BTW I fixed this in a custom module where I make other improvements and changes to the Navigation and Navigation Top Bar.
/** * Implements hook_preprocess_HOOK(). * * Make general changes to the Navigation Top Bar. */ function mymodule_preprocess_top_bar(array &$variables): void { // Add geysir to the top bar from core's navigation_top_bar module. if (\Drupal::service('module_handler')->moduleExists('geysir')) { $variables['local_tasks']['#local_tasks']['geysir'] = [ '#theme' => 'top_bar_local_task', '#link' => [ '#type' => 'html_tag', '#tag' => 'button', 'child' => [ 'icon' => [ '#type' => 'html_tag', '#tag' => 'span', '#attributes' => [ 'class' => ['geysir-icon'], ], ], 'text' => ['#plain_text' => t('Geysir')] ], '#attributes' => [ 'class' => ['toolbar-icon-geysir'], 'aria-pressed' => 'false', 'type' => 'button', ], '#attached' => [ 'library' => [ 'geysir/geysir-toolbar', ], ], ], ]; } }
And in CSS:
.toolbar-icon-geysir{ border: none; background: inherit; width: 100%; text-align: left; } .geysir-icon:before { content: '☐'; } .geysir-icon { display: inline-block; }