Skip to content

Instantly share code, notes, and snippets.

@elisechant
elisechant / footer.html
Created February 14, 2014 00:39
CDN jQuery includes
@elisechant
elisechant / namespace-an-application.scss
Last active January 2, 2016 01:49
Conceptual ideas for disallowed use of the SASS import directive. Throws errors: Import directives may not be used within control directives or mixins Refer to: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
@mixin App(
// usual config.scss stuff with set !default values
){
@import 'base';
@import 'ui.type';
@import 'ui.buttons';
// ...
}
// Init
@elisechant
elisechant / namespace.articleitem.js
Last active December 30, 2015 20:29
JS Module Prototype Skeleton
var MyNamespace = MyNamespace || {};
(function ($) {
"use strict";
var $w = $(window),
BU = MyNamespace.Util
;
@elisechant
elisechant / namespace.article.js
Last active December 30, 2015 20:29
JS Module Skeleton
var MyNamespace = MyNamespace || {};
(function ($) {
"use strict";
var $w = $(window),
BU = MyNamespace.Util
;
@elisechant
elisechant / head.php
Created December 2, 2013 01:42
IE7 Handling
<!DOCTYPE html>
<!--[if lt IE 8]> <html class="lte-ie7" lang="en-au"><![endif]-->
<!--[if IE 8]> <html class="ie8" lang="en-au"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en-au"> <!--<![endif]-->
<head>
<!-- Force IE to use highest browser compatibility -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--
@elisechant
elisechant / _config.scss
Created November 19, 2013 06:32
SASS ternary for debugging by layout painting
$DEBUG_LAYOUT: true;
@elisechant
elisechant / _units.type-coercion.scss
Created November 15, 2013 00:59
SASS Type Coercion
// Strip units from any value
//
@function strip-units($number) {
@return $number / ($number * 0 + 1);
}
// Convert pixels to ems
// $pxval may have units or be unitless
// eg. for a relational value of 12px write em(12) when the parent is 16px
@elisechant
elisechant / _neat.block-grid.scss
Created November 14, 2013 04:33
Block Grid for Bourbon's Neat
/*
|--------------------------------------------------------------------------
| Block Grid for Neat
|--------------------------------------------------------------------------
|
| An Automatic Rows type grid layout with no margins
|
| Overcomes a limitation of Bourbons's flex-grid(), where you can't set a
| value for $fg-gutter, impacting the width of the elements
|
@elisechant
elisechant / application.scss
Created October 12, 2013 22:34
#Anonymous SASS application Design Pattern Currently an untested concept. Different ways of thinking about how to handle css in more logical and functional ways. Possible use cases: - Child Theming contexts. Agency installs. - Or for applications where state needs to be persisted and shared, like for animations that reference one another?
// import plugins outside
@import 'bourbon';
@mixin application(
$config-var: 'foo',
$config-param: 200
) {
// application
@elisechant
elisechant / phone.html
Created October 12, 2013 22:22
phone href snippet
<a href="tel:+1800555199">1-800-555-199</a>