Skip to content
Snippets Groups Projects
Commit 277960c2 authored by Alberto Siles's avatar Alberto Siles Committed by Alberto Siles
Browse files

Improve tabs styles, set configuration 3rd shot

parent 897f046b
No related branches found
Tags 5.1.2
No related merge requests found
......@@ -473,12 +473,18 @@ function bootstrap_barrio_preprocess_menu_local_task(&$variables) {
$options = $url->getOptions();
$url->setOptions($options + $link['localized_options']);
$variables['item'] = Link::fromTextAndUrl($link['title'], $url);
}
/**
* Implements hook_preprocess_HOOK() for menu-local-tasks.html.twig.
*/
function bootstrap_barrio_preprocess_menu_local_tasks(&$variables) {
switch (theme_get_setting('bootstrap_barrio_tabs_style')) {
case 'pills':
$variables['nav-style'] = 'nav-pills';
$variables['nav_style'] = 'nav-pills';
break;
default:
$variables['nav-style'] = 'nav-tabs';
$variables['nav_style'] = 'nav-tabs';
break;
}
}
......
......@@ -14,11 +14,20 @@
*/
#}
{{ attach_library('bootstrap_barrio/tabs') }}
{%
set classes = [
'nav',
primary ? 'primary',
secondary ? 'secondary',
nav_style ? nav_style : 'nav-tabs',
]
%}
{% if primary %}
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
<ul class="nav {{ nav-style }} primary">{{ primary }}</ul>
<ul{{ attributes.addClass(classes) }}>{{ primary }}</ul>
{% endif %}
{% if secondary %}
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
<ul class="nav {{ nav-style }} secondary">{{ secondary }}</ul>
<ul{{ attributes.addClass(classes) }}>{{ secondary }}</ul>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment