Skip to content

Instantly share code, notes, and snippets.

View davidyeiser's full-sized avatar

David Yeiser davidyeiser

View GitHub Profile
@davidyeiser
davidyeiser / oo-html-good.html
Created April 25, 2013 13:08
HTML example matching oo-css-good.css
<h3 class="subhead-major subhead">
<h4 class="subhead-minor subhead">
@davidyeiser
davidyeiser / oo-html-bad.html
Created April 25, 2013 13:07
HTML example matching oo-css-bad.css
<h3 class="subhead">
<h4 class="minor-subhead">
@davidyeiser
davidyeiser / oo-css-good.css
Last active December 16, 2015 15:19
Object Oriented CSS good example
.subhead {
padding: 20px 0 10px 0;
font-family: Georgia, serif;
font-style: italic;
}
.subhead-major {
letter-spacing: 1px;
text-transform: uppercase;
color: #00f;
@davidyeiser
davidyeiser / oo-css-bad.css
Last active December 16, 2015 15:19
Object Oriented CSS Example
.subhead {
padding: 20px 0 10px 0;
font-family: Georgia, serif;
font-style: italic;
letter-spacing: 1px;
text-transform: uppercase;
color: #00f;
}
.minor-subhead {
@davidyeiser
davidyeiser / jquery-text-explosion.js
Created March 8, 2011 05:39
Associated jQuery for text explosion. As seen on http://gopotluck.com/
$(function() {
$("#email-signup-label").lettering();
var is_search_empty = $(".email-signup input").attr("value");
if (!is_search_empty == "") {
$("#email-signup-label").css({opacity:0});
}
$("#email-signup-label").click(function() {
$(".email-signup input").focus();
@davidyeiser
davidyeiser / example.css
Created February 14, 2012 16:36
SASS output
body { font-size: 16px; }
h1 { font-size: 68px; }
h2 { font-size: 26px; }
@davidyeiser
davidyeiser / sass_functions.rb
Created February 14, 2012 16:15
Adds the exp() function to SASS
module Sass::Script::Functions
def exp(value, power)
Sass::Script::Number.new(value.value**power.value)
end
end
@davidyeiser
davidyeiser / example.scss
Created February 14, 2012 16:35
SASS example
body { @include font-size(1) }
h1 { @include font-size(4) }
h2 { @include font-size(2) }
sass --watch FILENAME.scss:FILENAME.css -r sass_extensions.rb
@davidyeiser
davidyeiser / example.scss
Created February 14, 2012 16:22
Sass mixin for automatically determining modular scale font-size value
$font-size-base: 16px;
$font-size-minor: 10px;
@mixin font-size($scale: 1) {
font-size: round(
($font-size-base * ((exp(1.618, $scale) - exp(-0.618, $scale)) / 2.236)) +
($font-size-minor * ((exp(1.618, ($scale - 1)) - exp(-0.618, ($scale - 1))) / 2.236))
);
}