Skip to content

Commit

Permalink
Use srcset for store logo so it looks good in more conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
bookernath committed Oct 22, 2021
1 parent 8bbf4fe commit dc863cd
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 @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- 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 '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 dc863cd

Please sign in to comment.