Skip to content

Commit ffc51c4

Browse files
fix: separating util classes
1 parent ac2d0d4 commit ffc51c4

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

packages/components/bolt-video/src/video.twig

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,39 @@
1212
{% set collapsed = collapsed | default(true) %}
1313
{% set ratio = ratio ?? true %}
1414

15-
{#@todo @salem Is this used anywhere?#}
1615
{% set classes = [
1716
baseClass,
1817
collapsed is not null and collapsed == false ? "is-expanded" : "is-collapsed"
1918
] %}
2019

21-
22-
{% set videoTag %}
23-
{% include "@bolt/_video-tag.twig" %}
20+
{% set utilClasses = utils | default([]) %}
21+
{% set otherClasses = others | default([]) %}
22+
23+
{% for class in attributes["class"] %}
24+
{% if class starts with "u-" %}
25+
{% set utilClasses = utilClasses|merge([class]) %}
26+
{% else %}
27+
{% set otherClasses = otherClasses|merge([class]) %}
28+
{% endif %}
29+
{% endfor %}
30+
31+
{% set innerVideo %}
32+
{% include "@bolt/_video-tag.twig" with {
33+
attributes: {
34+
class: otherClasses
35+
}
36+
} %}
2437
{% endset %}
2538

2639
{% if ratio == true %}
2740
{% include "@bolt/ratio.twig" with {
2841
aspectRatioHeight: aspectRatioHeight ?? 9,
2942
aspectRatioWidth: aspectRatioWidth ?? 16,
30-
children: videoTag,
31-
attributes: attributes
43+
children: innerVideo,
44+
attributes: {
45+
class: utilClasses
46+
}
3247
} only %}
3348
{% else %}
34-
{{ videoTag }}
49+
{% include "@bolt/_video-tag.twig" %}
3550
{% endif %}

0 commit comments

Comments
 (0)