bootstrap_storybook-8.x-2.0/src/kits/default/src/components/navbar/navbar-brand.twig
src/kits/default/src/components/navbar/navbar-brand.twig
{#
/**
* @file
* Template for Navbar brand component.
*
* Available config:
* - text: the text to use for the brand.
* - path: the path for the link. Leave blank for no link.
* - image:
* - src: The source of the image
* - width: The width of the image
* - height: The height of the image
* - alt: The alternative text of the image
* - utility_classes: An array of utility classes.
*/
#}
{{ attach_library('BOOTSTRAP_STORYBOOK_SUBTHEME_MACHINE_NAME/navbar') }}
{% import _self as navbar_brand %}
{% set utility_classes = utility_classes|join(' ') %}
{% if path %}
<a href="{{ path }}" class="navbar-brand d-flex align-items-center {{ utility_classes }}" aria-label="{{ text }}">
{% if image %}
{% include "@BOOTSTRAP_STORYBOOK_SUBTHEME_MACHINE_NAME/logo/logo.twig" %}
{% endif %}
<div class="d-flex flex-column logo-text">
{% if text %}
<span class="logo-name ml-2">{{ text }}</span>
{% endif %}
{% if slogan %}
<span class="logo-slogan ml-2 text-muted small">{{ slogan }}</span>
{% endif %}
</div>
</a>
{% else %}
<span class="navbar-brand h1 mb-0 {{ utility_classes }}" aria-label="{{ text }}">
{% if image %}
{% include "@BOOTSTRAP_STORYBOOK_SUBTHEME_MACHINE_NAME/logo/logo.twig" %}
{% endif %}
<span class="logo-text ml-2">{{ text }}</span>
</span>
{% endif %}
{% macro image(src, width, height, alt) %}
<img src="{{ src }}" width="{{ width|default(30) }}" height="{{ height|default('auto') }}" alt="{{ alt|default('') }}" class="mr-2" />
{% endmacro %}
