We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 712b4e7 commit 39a4fe5Copy full SHA for 39a4fe5
templates/patterns/button/pattern-button.html.twig
@@ -4,9 +4,19 @@
4
* Button pattern.
5
*/
6
#}
7
-{% if icon %}
8
- {% set icon_data = icon is iterable ? icon : { name: icon } %}
9
- {% set _icon = { path: bcl_icon_path }|merge(icon_data) %}
+{% if icon %}
+ {% set _icon = {
+ path: bcl_icon_path,
10
+ name: icon,
11
+ attributes: create_attribute()
12
+ } %}
13
+ {% if label is empty and attributes['aria-label'] is not empty %}
14
+ {% set _icon = _icon|merge({
15
+ attributes: _icon.attributes
16
+ .setAttribute('aria-hidden', 'true')
17
+ .setAttribute('focusable', 'false')
18
+ }) %}
19
+ {% endif %}
20
{% endif %}
21
{% include '@oe-bcl/button' with {
22
'label': label,
0 commit comments