Skip to content

Instantly share code, notes, and snippets.

@matthewbeta
matthewbeta / Gruntfile.js
Created February 17, 2014 09:48
Grunt Bolierplate
module.exports = function(grunt) {
// Show elapsed time after tasks run
require('time-grunt')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
});
@matthewbeta
matthewbeta / Web-Safe-fonts-#1.markdown
Created May 21, 2014 23:40
A Pen by matthew jackson.

Web Safe fonts #1

Gonna try and make some nice typographic things with websafe fonts. Started with the easiest and best

A Pen by matthew jackson on CodePen.

License.

@matthewbeta
matthewbeta / Web-Safe-Fonts-#2.markdown
Created May 22, 2014 21:26
A Pen by matthew jackson.
module.exports = function(grunt) {
var dev = {
deployConfiguration: grunt.file.readYAML("deployment.dev.yml"),
},
prod = {
deployConfiguration: grunt.file.readYAML("deployment.yml");
},
bucket = 'ember-build-dsh';
// more stuff
sass: {
dev: {
options: { // Target options
style: 'expanded'
},
},
prod: {
options: {
@matthewbeta
matthewbeta / nav.scss
Last active August 29, 2015 14:08
flexible, vertically centered navigation
$color-nav-bg: grey
$color-nav-bg-active
$stretch: -100px; // taller/wider than your links would ever need to stretch
// 1. Set the nav ul to be table
.nav-list {
display: table;
width: 100%;
}
// 2. Set the nav items to be table-cell
@matthewbeta
matthewbeta / parent-selector-modifiers
Created January 16, 2015 09:32
nesting parent-selector modifiers
/* instead of this */
.mobile {
.my-module {
color: red;
}
}
.desktop {
.my-module {
color: blue;
}
/* This */
.my-module {
background: #DDD;
&-header {
padding: 10px;
}
&-link {
color: red;
}
}
@matthewbeta
matthewbeta / resize-debounce.js
Created March 24, 2015 11:24
Resize event debounce from CSS tricks
var resizeTimer;
$(window).on('resize', function(e) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
// Run code here, resizing has "stopped"
}, 250);
@matthewbeta
matthewbeta / visuallyhidden.css
Last active August 29, 2015 14:25 — forked from sousk/gist:1280108
Hide Visually HTML5 BP style
/* Hide only visually, but have it available for screenreaders: h5bp.com/v */
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;