Move padding from list items to links

So that the padding takes up the full space within the tab, move the
padding to the link element. This requires adding a preprocess function
to the theme file and removing the classes from the local task template.

References #341
This commit is contained in:
Oliver Davies 2021-01-10 22:02:27 +00:00
parent 9bcb8bb847
commit 3b6ad20486
2 changed files with 8 additions and 1 deletions

View file

@ -25,3 +25,10 @@ function opdavies_preprocess_page(array &$variables): void {
$variables['#attached']['library'][] = 'opdavies/twitter';
}
}
/**
* Implements hook_preprocess_HOOK().
*/
function opdavies_preprocess_menu_local_task(array &$variables): void {
$variables['link']['#options']['attributes']['class'][] = 'block px-5 py-2';
}

View file

@ -15,7 +15,7 @@
*/
#}
{% set linkClasses = [
'mt-3 ml-3 px-4 py-2 block border border-gray-200',
'mt-3 ml-3 border border-gray-200',
is_active ? 'underline bg-gray-100' : 'bg-white',
] %}
<li{{ attributes.addClass(linkClasses) }}>