File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
packages/components/bolt-image/src Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ class BoltImage extends withLitHtml() {
125
125
}
126
126
127
127
const _isJpg = path . extname ( src ) === '.jpg' ;
128
- const _canUseRatio = ratioW > 0 && ratioH > 0 && useRatio ;
128
+ const _canUseRatio = ratioW > 0 && ratioH > 0 && useRatio && ! cover ;
129
129
// Only JPGs allowed, PNGs can have transparency and may not look right layered over placeholder
130
130
const _canUsePlaceholder = ( _canUseRatio || cover ) && _isJpg ;
131
131
@@ -177,7 +177,9 @@ class BoltImage extends withLitHtml() {
177
177
return html `
178
178
< noscript >
179
179
< img
180
- class ="${ cx ( 'c-bolt-image__image' ) } "
180
+ class ="${ cx ( 'c-bolt-image__image' , {
181
+ 'c-bolt-image--cover' : cover ,
182
+ } ) } "
181
183
src ="${ src } "
182
184
alt ="${ ifDefined ( alt ? alt : undefined ) } "
183
185
srcset ="${ ifDefined ( ! lazyload ? srcset || src : undefined ) } "
Original file line number Diff line number Diff line change 27
27
28
28
{% set is_jpg = src | split (' .' )| last == " jpg" %}
29
29
{% set useAspectRatio = useAspectRatio ?? true %}
30
- {% set can_use_ratio = width > 0 and height > 0 and useAspectRatio is sameas(true ) %}
30
+ {% set can_use_ratio = width > 0 and height > 0 and useAspectRatio is sameas(true ) and object is sameas( false ) %}
31
31
{# Only JPGs allowed, PNGs can have transparency and may not look right layered over placeholder #}
32
32
{% set can_use_placeholder = can_use_ratio or cover %}
33
33
You can’t perform that action at this time.
0 commit comments