File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/_patterns/02-components/bolt-image/src Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 94
94
{% endif %}
95
95
96
96
{% set attributes = create_attribute(attributes | default({})).addClass(' c-bolt-image' ) %}
97
- {% set styles = attributes.getAttribute (' style' ) | split(' ' ) | merge([
98
- " padding-top: #{ratio};"
99
- ]) %}
100
- {% set attributes = attributes.setAttribute (' style' , styles | join(' ' )) %}
101
-
102
97
103
98
{% set imageAttributes = create_attribute(imageAttributes | default({})).addClass([
104
99
" c-bolt-image__img" ,
147
142
{% endset %}
148
143
<bolt -image >
149
144
{% block image_content %}
150
- {% if ratio == true %}
145
+ {% if width > 0 and height > 0 and ratio == true %}
151
146
{% embed " @bolt/ratio.twig" with {
152
- attributes : attributes
147
+ attributes : attributes ,
148
+ aspectRatioHeight : height * 1 ,
149
+ aspectRatioWidth : width * 1
153
150
} %}
154
151
{% block ratio_content %}
155
152
{{ ext == " jpg" ? imagePlaceholder : " " }}
You can’t perform that action at this time.
0 commit comments