Skip to content

Commit

Permalink
Use srcset for store logo so it looks good in more conditions (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
bookernath authored Nov 4, 2021
1 parent b4ad913 commit 10fd59d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed Quick View modal "X" button focus bubble being slightly off center [#2130](https://github.com/bigcommerce/cornerstone/pull/2130)
- Apply dependency updates (jest & lighthouse). [#2132](https://github.com/bigcommerce/cornerstone/pull/2132)
- Update lang file for FR locale. [#2139](https://github.com/bigcommerce/cornerstone/pull/2139)
- Update store logo to use `srcset`. [#2136](https://github.com/bigcommerce/cornerstone/pull/2136)

## 6.1.1 (10-01-2021)
- Fix product images on PDP has clipped outline. [#2124](https://github.com/bigcommerce/cornerstone/pull/2124)
Expand Down
17 changes: 12 additions & 5 deletions templates/components/common/store-logo.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<a href="{{urls.home}}" class="header-logo__link" data-header-logo-link>
{{#if settings.store_logo.image}}
{{#if theme_settings.logo_size '===' 'original'}}
<img class="header-logo-image-unknown-size" src="{{getImage settings.store_logo.image 'logo_size'}}" alt="{{settings.store_logo.title}}" title="{{settings.store_logo.title}}">
<img class="header-logo-image-unknown-size"
src="{{getImage settings.store_logo.image 'logo_size'}}"
alt="{{settings.store_logo.title}}"
title="{{settings.store_logo.title}}">
{{else}}
<div class="header-logo-image-container">
<img class="header-logo-image" src="{{getImage settings.store_logo.image 'logo_size'}}" alt="{{settings.store_logo.title}}" title="{{settings.store_logo.title}}">
</div>
<div class="header-logo-image-container">
<img class="header-logo-image"
src="{{getImage settings.store_logo.image 'logo_size'}}"
srcset="{{getImageSrcset1x2x settings.store_logo.image theme_settings.logo_size}}"
alt="{{settings.store_logo.title}}"
title="{{settings.store_logo.title}}">
</div>
{{/if}}
{{else}}
<span class="header-logo-text">{{settings.store_logo.title}}</span>
<span class="header-logo-text">{{settings.store_logo.title}}</span>
{{/if}}
</a>

0 comments on commit 10fd59d

Please sign in to comment.