Skip to content

Instantly share code, notes, and snippets.

View pfulton's full-sized avatar

Patrick Fulton pfulton

View GitHub Profile
@pfulton
pfulton / fontsizer.scss
Created February 16, 2012 19:47
A quick & dirty relative font-sizing mixin.
// quick relative font-sizing mixin.
// I wrote this before finding Anthony Short's awesome StitchCSS gem: https://github.com/anthonyshort/stitch-css/
// his relative font-sizing function is here: https://github.com/anthonyshort/stitch-css/blob/master/stylesheets/stitch/patterns/text/_rem.scss
$base-font-size: 16px;
@mixin font-sizer($font-size, $base-font-size) {
font-size: ($font-size / $base-font-size) * 1em;
}
@pfulton
pfulton / scale.scss
Created May 17, 2012 17:41
Compass "scale" mixin for calculating ems
// for the life of me, I can't track down the original place where I found this.
// syntax for scale mixin is like this
// property, sizes in px, context
//@include scale(padding, (16, 14, 12, 9), 20);
// 16px is default context size
@mixin scale($props, $sizes, $base: 16) {
$values: ();
$sublists: false;
@pfulton
pfulton / sass-compass-resources.txt
Last active May 30, 2016 12:51
Sass & Compass Resources
Sass and Compass Resources
=====================================================
***ONLINE***
> Official: http://sass-lang.com
> Official: http://compass-style.org
> http://thesassway.com
@pfulton
pfulton / state-abbreviations.txt
Created June 9, 2012 00:16
U.S. State Abbreviations
AL
AK
AZ
AR
CA
CO
CT
DE
DC
FL
@pfulton
pfulton / ee-resources.txt
Created July 30, 2012 20:38
EE Resources
Solspace: http://www.solspace.com
Pixel & Tonic: http://pixelandtonic.com/
Low: http://gotolow.com/
Stash: https://github.com/croxton/Stash
----
Helpful posts:
Viget has some great EE-related posts. Just Google for them, or start here:
@pfulton
pfulton / hd-images.scss
Created August 20, 2012 18:33 — forked from robtarr/mixins.scss
Retina SASS mix-in
@mixin hd($defaultPath, $hdPath) {
// the non-hd image - use data URI for this
background-image: inline-image($defaultPath);
// the IE fall-back for non-data URI support
.lt-ie9 & {
background-image: image-url($defaultPath);
}
// the HD version - use regular image path to prevent downloading non-hd version, too
@media (-webkit-min-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),(min-device-pixel-ratio: 1.5) {
background-image: image-url($hdPath);
@pfulton
pfulton / base.scss
Created September 12, 2012 15:55
Placeholder Selectors, Mixins and Media Queries: oh my!
/* THE BASE FILE WHERE YOU IMPORT ALL YOUR STUFF & MAYBE DO YOUR MEDIA QUERIES */
@import "mixins";
@media only screen and (min-width: 40.625em) {
@import "lib/placeholders";
@import "layout/medium";
}
@pfulton
pfulton / data-uri.css
Created September 12, 2012 20:59
data URI downloading
.box {
background: big-ass-data-uri-string-for-non-retina-hd-image;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3 / 2), (min-device-pixel-ratio: 1.5) {
.box {
background: big-ass-data-uri-string-for-retina-hd-image;
}
}
@pfulton
pfulton / micro-address.html.haml
Created October 3, 2012 15:58
Microformat & Microdata Markup for Address in Haml
-# Because I always forget...
-# Example markup for contact info (client's address) in Haml with both Microformats & Microdata
%article.vcard{:itemscope => true, :itemtype => 'http://schema.org/Organization'}
%h1.fn.org{:itemprop => 'name'} Company Name
%div.adr{:itemprop => 'address', :itemscope => true, :itemtype => 'http://schema.org/PostalAddress'}
%span.street-address{:itemprop => 'streetAddress'}
%span.locality{:itemprop => 'addressLocality'}
%span.region{:itemprop => 'addressRegion'}
%span.postal-code{:itemprop => 'postalCode'}
@pfulton
pfulton / block.html
Created October 30, 2012 18:48
Make entire "block" clickable
<article class="my-element">
<h1>Article Title</h1>
<p>Teaser text lorem ipsum.</p>
<a href="full-article.html">Read More</a>
</article>