bootstrap_storybook-8.x-2.0/src/components/badge/badge.twig

src/components/badge/badge.twig
{#
/**
 * @file
 * Template for a Badge component.
 *
 * Available config:
 * - html_tag: The HTML tag to use for the bade. Defaults to span.
 * - type: primary | secondary | success | danger | warning | info | light | dark
 * - utility_classes: An array of utility classes.
 * - content: The content of the badge.
 * - url: if anchor add a url, html_tag will be set to a automatically.
 */
#}
{% set classes = [
  'badge',
  type ? 'badge-' ~ type,
]|merge(utility_classes ? utility_classes : []) %}

{% set html_tag = html_tag ?? 'span' %}

{% if url %}
  {% set html_tag = 'a' %}
  {% set url = url|render %}
{% endif %}

{% if content %}
  <{{ html_tag }} {{ url ? 'href=' ~ url }} class="{{ classes|join(' ') }}">

  {% block content %}
    {{ content }}
  {% endblock %}

  </{{ html_tag }}>
{% endif %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc