Skip to content

Commit 9dd9f18

Browse files
author
Daniel Morse
committed
fix: skip 'imageAttributes' in background component if using image pattern
1 parent 32c1733 commit 9dd9f18

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,16 @@
5656

5757
{% set itemAttributes = item.pattern ~ "Attributes" %}
5858
{% set ratioKey = item.pattern == "image" ? "useAspectRatio" : "ratio" %}
59+
60+
{% if item.pattern != "image" %}
61+
{% set item = item | merge({
62+
(itemAttributes): {
63+
class: ["c-bolt-background__#{item.pattern}"]
64+
}
65+
}) %}
66+
{% endif %}
67+
5968
{% include pattern_template(item.pattern) with item | merge({
60-
(itemAttributes): {
61-
class: ["c-bolt-background__#{item.pattern}"]
62-
},
6369
(ratioKey): false,
6470
lazyload: item.lazyload ?? true,
6571
cover: true

0 commit comments

Comments
 (0)