Skip to content

Instantly share code, notes, and snippets.

@darren131
darren131 / gist:3030083
Created July 1, 2012 23:51
The power of the ampersand
.product {
h1 {
color: #c00;
}
.image {
float: left;
}
@darren131
darren131 / gist:2962766
Created June 20, 2012 22:57
JavaScript: Closure
(function( $ ){
// set up global variables
var ObjectName;
// Navigation object
ObjectName = {
method: function() {
},
@darren131
darren131 / gist:2926833
Created June 13, 2012 22:20
CSS: Image Replacement
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@darren131
darren131 / gist:2926558
Created June 13, 2012 21:18 — forked from padolsey/gist:527683
JavaScript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@darren131
darren131 / arrows.less
Created May 30, 2012 00:25
CSS only arrows in LESS
// HOW TO USE
//
// @direction: up;
// .class {
// .arrow(@direction, #c00, 20px);
// }
//
.arrow(up, @color, @size) {
width: 0;
@darren131
darren131 / sprite.less
Created April 18, 2012 01:37
Sprite LESS Snippet. Someone else has probably done this already, but I thought I'd share it nevertheless.
@spritePath: '../images/sprite.png';
.sprite(@url: @spritePath, @xpos: 0, @ypos: 0) {
background-image: url(@url);
background-repeat: none;
background-position: @xpos @ypos;
}