Skip to content

Instantly share code, notes, and snippets.

@rickydazla
Created April 10, 2017 15:16
Show Gist options
  • Save rickydazla/0289f663ef17d98de73eb85c2a9b5997 to your computer and use it in GitHub Desktop.
Save rickydazla/0289f663ef17d98de73eb85c2a9b5997 to your computer and use it in GitHub Desktop.
Custom social widget for Shopify using SymbolSet Social Icon fonts
<div class="addthis_toolbox" addthis:url="{{ shop.url }}{{ product.url }}" addthis:title="{{ page_title }} | {{ shop.name }}" addthis:description="{{ page_description }}">
<div class="tricky-sharing">
<a class="addthis_button_facebook"><i class="ss-facebook"></i></a>
<a class="addthis_button_twitter"><i class="ss-twitter"></i></a>
<a class="addthis_button_pinterest ss-icon ss-pinterest" pi:pinit:media="{{ product.images[0] | product_img_url: '1024x1024' }}"></a>
<!-- you can also try addthis_button_pinterest_share if above doesn't work! -->
</div>
</div>
/* just for the fun of it */
@mixin transition($transition-property, $transition-time, $method) {
-webkit-transition: $transition-property $transition-time $method;
-moz-transition: $transition-property $transition-time $method;
-ms-transition: $transition-property $transition-time $method;
-o-transition: $transition-property $transition-time $method;
transition: $transition-property $transition-time $method;
}
%thereset {
clear: both;
display: inline-block;
float: none !important;
line-height: normal;
padding: 0 !important;
position: relative;
width: auto !important;
text-decoration: none;
white-space:normal;
}
$theSocialShare_FontSize : 24px;
$theSocialShare_Height : $theSocialShare_FontSize + 4px; /* for Symbol Set */
$theSocialShare_Color : #7f7f7f;
$theSocialShare_HoverColor : #ff3300;
$theSocialShare_Distance : 5px;
.addthis_toolbox{@extend %thereset;}
.tricky-sharing{
a{
@extend %thereset;
@include transition(color, 0.2s, ease-in-out);
color:$theSocialShare_Color;
font-size:$theSocialShare_FontSize;
width: $theSocialShare_FontSize;
margin-right: $theSocialShare_Distance;
height: $theSocialShare_Height;
cursor:pointer;
&:hover {
color:$theSocialShare_HoverColor;
}
&:last-child {
margin-right: 0;
}
}
.addthis_button_pinterest, .addthis_button_pinterest{ // try both!
iframe, .pin_it_iframe_widget, span { // this covers either ^
height: $theSocialShare_Height !important;
width: $theSocialShare_FontSize !important;
left: 0;
opacity: 0;
filter:alpha(opacity=0);
position: absolute;
top: 0;
z-index: 1;
}
}
i{
display: block;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment