Skip to content

Instantly share code, notes, and snippets.

View Stanton's full-sized avatar
💃

Paul Stanton Stanton

💃
View GitHub Profile

Given the following markup:

<fieldset id="comp-1">
    <legend id="comp-1[label]">Legend One</legend>    
    <label for="dd-1" id="dd-1[label]">Day</label>
    <input id="dd-1" type="text" />
</fieldset>

@Stanton
Stanton / SassMeister-input-HTML.html
Last active August 29, 2015 14:18
Generated by SassMeister.com.
<nav>
<ul class="nav">
<li class="nav__item"><a href="#" class="nav__link">The workshop</a></li><!--
--><li class="nav__item nav__item--current"><a href="#" class="nav__link">2013 schedule</a></li><!--
--><li class="nav__item"><a href="#" class="nav__link">About CSSWizardry</a></li><!--
--><li class="nav__item"><a href="#" class="nav__link">Contact</a></li>
</ul>
</nav>
@Stanton
Stanton / gist:73385d219ab27c1eee74
Created March 9, 2015 08:34
Add a class then remove it on animation or transition end
// Assume .foo triggers a CSS animation, or a transition and that we wish to
// remove the .foo class when the animation completes.
//
// Useful for declarative animation class names like .shake
// on animation end
var animationEnd = 'webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationend';
$('.foo')
.addClass('bar')
@Stanton
Stanton / SassMeister-input-HTML.html
Created January 21, 2015 20:45
Generated by SassMeister.com.
<p class="foo">foo</p>
<p class="foo foo--bar">foo bar</p>
@Stanton
Stanton / SassMeister-input.scss
Created November 25, 2014 15:23
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
.block {
color: red;
&__element {
color: white;
@Stanton
Stanton / post-merge
Created October 22, 2014 09:50
Grunt post-merge Git hook
PATH="/usr/local/bin:/usr/local/share/npm/bin:$PATH"
#!/bin/sh
grunt sass:dev
@Stanton
Stanton / Asset.css
Created November 2, 2012 14:36
LESS noise texture mixin
/**
* Adds a transparent noise texture as a background image to a given element.
* Texture strength can be controlled with @opacity parameter.
*/
.noise (@opacity: .3) {
&:before {
bottom: 0;
content: "";
left: 0;
opacity: @opacity;
@Stanton
Stanton / users_controller.php
Created July 20, 2012 14:01
HoM Users Controller
<?php
class UsersController extends AppController {
var $name = 'Users';
var $scaffold = 'admin';
var $components = array('JqImgcrop');
var $helpers = array('Javascript', 'Thumbnail', 'CropImage');
function beforeFilter() {
@Stanton
Stanton / Asset.js
Created June 11, 2012 08:29
Get document height
function getDocumentHeight() {
return Math.max(
Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
Math.max(document.body.clientHeight, document.documentElement.clientHeight)
);
}
@Stanton
Stanton / html.html
Created May 29, 2012 10:48
light on dark inset text
text-shadow: 0px -1px 0px #666;