Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

v1.3.0 #80

Merged
merged 62 commits into from Jun 3, 2014
Merged

v1.3.0 #80

merged 62 commits into from Jun 3, 2014

Conversation

cshold
Copy link
Contributor

@cshold cshold commented May 22, 2014

JavaScript

  • New shop.js.liquid file structure
  • Added product image thumbnail swapping
  • Collection sorting and proper grid/list collection views

Liquid

  • Added related products snippet
  • Added collection sorting (uses some JS)

Theme Settings

  • Restructured theme settings to be in line with Shopify standards
  • Added basic colors
  • Added more social links
  • Product quantity is now toggle-able on the product page

CSS

  • Updated Sass variables and organized them slightly
  • Removing any extra declarations that don't need to be made
  • Focus on touch friendly styles (especially surrounding ajax cart)
  • Mobile-friendlier padding and margins on general layout
  • Made the breadcrumb styles more usable
  • IE10 fix for the header layout (needed 100% width with no margins)
  • Less-specific selectors to avoid conflicts
  • Added hidden (accessible) labels for short forms
  • Added an icon font for social and payment card icons

@cshold cshold changed the title Slim styles Clean styles, product thumbnail swap with new JS file structure May 23, 2014
@@ -1,5 +1,39 @@
$(function() {
window.shop = window.shop || {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpiotrowicz @richgilbank

Thoughts on this structure for Timber's JS file? Before it was simply a docready call, but I'd prefer to push toward some kind of structure.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, only thing is might want to create a more specific var name, TimberShop or something

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - a few thoughts, though they're by no means deal breakers:

  • You're creating a global shop object if one doesn't exist, but then you're defining shop (line 3) as a local. If this code was wrapped in an IIFE, you'd be creating two objects which could be potentially tricky to diagnose. One way around this is to initialize the object (window.shop = window.shop || {}) then add properties and functions to it below, like shop.init = function(){...} (no var keyword). Added benefit: no need to use commas to separate properties. Alternatively, you could add properties to the shop's prototype like shop.prototype.init = function(){...}, but that may add unnecessary complexity
  • Personally, I like to reserve el for a single element like Backbone does. That may just be preference though
  • I appreciate the DOM caching - 'tis good practice, though there's a few other selectors throughout. Maybe stuff all of them into your DOM cache object (el currently)?

All in all though, I feel this is much more extensible and readable :)

@include transition(all 0.1s ease-out);

:not(body.ajaxify-touch) & {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't work with IE8, assuming that's ok for Timber?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, just sets the border as transparent to get ready for a CSS transition so it can be ignored for IE8.

@@ -1,5 +1,36 @@
$(function() {
window.timber = window.timber || {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mpiotrowicz @richgilbank

Looks like I lost the line comment after my update, but appreciate the notes. Rich, I assume this is what you meant by splitting the methods up?

Cached elements are more aptly named. Will consider moving other selectors up there too, though I sometimes prefer keeping the relevant ones with their methods.. just preference there.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are still in the conversation view under "Show outdated diff", but yep, that's what I meant!
🐓💨

@cshold cshold changed the title Clean styles, product thumbnail swap with new JS file structure Clean styles, JS file structure, Settings structure May 26, 2014
@cshold cshold changed the title Clean styles, JS file structure, Settings structure v1.3.0 May 26, 2014
cshold added a commit that referenced this pull request Jun 3, 2014
@cshold cshold merged commit 81e6164 into master Jun 3, 2014
@cshold cshold deleted the slim-styles branch June 3, 2014 17:05
<li>
<img src="{{ type | payment_type_img_url }}" />
</li>
{% if type == "diners_club" %}<li>c</li>{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do it this way? also why no case statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the icon font allows for flexibility when defining colour, similar to the social icons. Forgot about using case in liquid, I'll switch to using that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, it makes more sense to define the icons in css with content to keep the generic characters out of the markup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if implementing an icon font, can this be done in a less intrusive way? If the font fails there's no fallback and it's not accessible. Something like the following would be more robust
<span class="icon-fallback-text"> <span class="icon icon-visa" aria-hidden="true"></span> <span class="text">VISA</span> </span>
More info here under "Critical Icons with Text Fallback" - http://filamentgroup.com/lab/bulletproof_icon_fonts.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beat me to it! But yeah check out the article above for a really solid implementation

cimocimocimo pushed a commit to cimocimocimo/Theia-Shopify-Theme that referenced this pull request Nov 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants