-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathicon.html.twig
More file actions
44 lines (39 loc) · 1.06 KB
/
icon.html.twig
File metadata and controls
44 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{% import ids_get('macros/html') as html %}
{% set size = size|default('') %}
{% set attr = attr|default({}) %}
{% set classes = attr.class|default('') %}
{% if custom_path is defined %}
{% set link_href = custom_path %}
{% elseif name is defined %}
{% set link_href = ibexa_icon_path(name) %}
{% endif %}
{% set icon_classes =
html_cva(
base: 'ids-icon',
variants: {
size: {
tiny: 'ids-icon--tiny',
'tiny-small': 'ids-icon--tiny-small',
small: 'ids-icon--small',
'small-medium': 'ids-icon--small-medium',
medium: 'ids-icon--medium',
'medium-large': 'ids-icon--medium-large',
large: 'ids-icon--large',
'extra-large': 'ids-icon--extra-large'
}
}
)
%}
{% set attr =
attr|merge({
class: icon_classes.apply(
{
size
},
classes
)
})
%}
<svg {{ html.attributes(attr) }}>
<use xlink:href="{{ link_href }}" />
</svg>