Skip to content

Instantly share code, notes, and snippets.

@benknight
benknight / SassMeister-input.scss
Last active August 29, 2015 13:55
Yelp Fixed Header v1
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@import "compass/css3/transform";
@import "compass/css3/transition";
// Prevent "jump" in content offset
@benknight
benknight / gist:8534607
Last active January 3, 2016 23:19
Yelp Fixed Header (Plain)
/* Prevent "jump" in content offset */
.fixed-header body {
padding-top: 77px;
}
.fixed-header .app-header {
position: fixed;
top: 0;
width: 100%;
}
@benknight
benknight / gist:8497929
Last active January 3, 2016 17:49
Full-width Yelp search with fixed map
.app-header {
top: 0;
width: 100%;
}
.app-header,
#dropper,
.autocomplete_choices {
z-index: 99999 !important; /* KAPOW! */
position: fixed !important;
@benknight
benknight / gist:8416098
Created January 14, 2014 10:09
Breakdown of how Chrome's download tab progress bars work
<canvas>, -webkit-image-set
@benknight
benknight / gist:8407644
Created January 13, 2014 20:37
How to restart a GIF animation

TODO

Symmetric animations versus asymmetric

@benknight
benknight / gist:8375198
Last active January 2, 2016 23:19
Wider Yelp.com pages (jQuery only)
/* Baz */
.widen .biz-page-subheader .column-alpha {
width: 100%;
}
.widen .biz-page-subheader .column-beta {
width: 660px;
}
.widen .mapbox-map {
@benknight
benknight / SmartyPants.pl
Created December 20, 2013 21:13
EducateQuotes from John Gruber's "smartypants"
sub EducateQuotes {
#
# Parameter: String.
#
# Returns: The string, with "educated" curly quote HTML entities.
#
# Example input: "Isn't this fun?"
# Example output: &#8220;Isn&#8217;t this fun?&#8221;
#
@benknight
benknight / gist:7654020
Created November 26, 2013 05:55
Improves scrolling perf on Airbnb search page
// Original Logic:
// ---------------
//
// this.initSidebarHeader=function(){
// this.$node.on(
// "scroll",(
// function(){
// var searchResultsPos=this.select("searchResultsSelector").offset();
// if(searchResultsPos.top<=100){
// this.$node.addClass("stuck");
@benknight
benknight / gist:7391416
Last active December 27, 2015 21:19
Apply kerning pairs
/*
* http://aestheticallyloyal.com/public/optimize-legibility/
* http://adamdscott.com/kerning-for-the-web/
* http://ascott1.github.io/labs.adamdscott/kern/optimize.html
*/
body {
text-rendering: optimizeLegibility !important; /* Deprecated I'm pretty sure */
-webkit-font-feature-settings: "kern" 1; /* The new w3c hotness */
-moz-font-feature-settings: "kern" 1;
font-feature-settings: "kern" 1;
@benknight
benknight / gist:7389561
Last active December 27, 2015 21:09
Connect review borders to sidebar border
.ylist-bordered.reviews > li {
margin-right: -30px;
padding-right: 30px;
}
.feed-header:after {
margin-right: -15px;
border-color: #e5e5e1;
}