Skip to content

Instantly share code, notes, and snippets.

View micahgodbolt's full-sized avatar

Micah Godbolt micahgodbolt

View GitHub Profile
@micahgodbolt
micahgodbolt / Gruntfile.js
Last active December 3, 2018 12:39
Quick grunt setup with compass compile and live reload
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: { // Task
dist: { // Target
options: { // Target options
environment: 'production',
config: 'config.rb'
}
@micahgodbolt
micahgodbolt / SassMeister-output.css
Created September 4, 2013 22:54
A Sass Function for sorting a list of numbers.
div {
original: 12 10 13 9;
sorted: 9 10 12 13;
}
@micahgodbolt
micahgodbolt / sassbites7.scss
Created September 12, 2013 18:49
SassBites#7 Code
$foo: 1;
$bar: 6;
@while $foo < $bar {
h#{$foo} { // do something
font-size: ($bar - $foo)+em;
}
$foo: $foo + 1; // advance a counter
}
@micahgodbolt
micahgodbolt / 1_index.html
Last active December 25, 2015 19:49
Sass Bites #11 Code
<div class="box">
<div class="arrow"></div>
</div>
@micahgodbolt
micahgodbolt / PDXSass_0214.scss
Last active August 29, 2015 13:56
Code from PDX Sass demo given February 2014.
///////////////////////////////////
/// Major Features of Sass 3.3
///////////////////////////////////
// @at-root
.widget {
@at-root .body {
background: red;
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Created February 18, 2014 00:11
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.4)
// Compass (v1.0.0.alpha.18)
// ----
$navigation: (
background: blue,
color: green,
line-height: 1.3,
is-expanded: (
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Created February 18, 2014 17:09
Multi-level Map Mixin
// ----
// Sass (v3.3.0.rc.4)
// Compass (v1.0.0.alpha.18)
// ----
$navigation: (
background: blue,
color: green,
line-height: 1.3,
is-expanded: (
@micahgodbolt
micahgodbolt / memoization.scss
Last active August 29, 2015 13:57
Memoization Example
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
//// Fibonacci Function
@function fibonacci($n) {
$fib: 0 1;
@for $i from 1 through nth($n,1) {
$new: nth($fib, length($fib)) + nth($fib, length($fib) - 1);
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Last active August 29, 2015 14:01
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
// Using maps as the map key allows you to
// pull the proper value based on multiple inputs/choices
// this helps to avoid nested if statements (if i win, and you lose)
$test: (
@micahgodbolt
micahgodbolt / SassMeister-input.scss
Created May 29, 2014 21:01
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
@mixin thing($ratio) {
foo: $ratio;
bar: nth($ratio, 1);
baz: nth($ratio, 3);
}