Skip to content
Snippets Groups Projects
Commit 85efdd6d authored by Florent Torregrosa's avatar Florent Torregrosa
Browse files

Issue #3292592 by mapac, Grimreaper: Bootstrap 5 : Components > Close button

parent 9567f4a9
No related branches found
No related tags found
1 merge request!91Issue #3292592: Bootstrap 5 : Components > Close button
close_button:
label: "Close button"
description: "A generic close button for dismissing content like modals and alerts. https://getbootstrap.com/docs/5.2/components/close-button"
category: "Button"
variants:
default:
label: "Default"
white:
label: "White"
settings:
disabled:
type: "boolean"
label: "Disabled?"
description: "Is the button disabled?"
preview: false
allow_expose: true
allow_token: true
aria_label:
type: "textfield"
label: "Aria label"
description: "Name of the close button for assistive technology."
preview: "Close"
allow_token: true
<div class="bg-dark">
{{ include('pattern-close-button.html.twig') }}
</div>
{% if variant and variant|lower != 'default' %}
{% set attributes = attributes.addClass('btn-close-' ~ variant) %}
{% endif %}
{% set attributes = attributes.addClass('btn-close') %}
{% set attributes = attributes.setAttribute('aria-label', aria_label|default('Close'|t)) %}
{% if disabled %}
{% set attributes = attributes.setAttribute('disabled', disabled) %}
{% endif %}
<button{{ attributes.setAttribute('type', 'button') }}></button>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment