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
34 lines
681 B
Text
34 lines
681 B
Text
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Functions to support theming in the Tailwind CSS theme.
|
|
*/
|
|
|
|
use Drupal\opdavies_blog\Entity\Node\Post;
|
|
|
|
/**
|
|
* Implements hook_preprocess_HOOK().
|
|
*/
|
|
function opdavies_preprocess_page(array &$variables): void {
|
|
/** @var Post|null $node */
|
|
$node = $variables['node'] ?? NULL;
|
|
if (!$node) {
|
|
return;
|
|
}
|
|
|
|
if (!$node instanceof Post) {
|
|
return;
|
|
}
|
|
|
|
if ($node->hasTweet()) {
|
|
$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';
|
|
}
|