Skip to content

Instantly share code, notes, and snippets.

@maskingtape
maskingtape / dabblet.css
Created June 25, 2013 16:28
input placeholder width
/**
* input placeholder width
*/
input {
width: auto;
}
@maskingtape
maskingtape / dabblet.css
Created June 13, 2013 11:55
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div {
width: 190px;
font-size: 62.5%;
font-family: arial;
font-size :14px;
}
@maskingtape
maskingtape / dabblet.css
Created June 13, 2013 11:46
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div {
width: 190px;
font-size: 62.5%;
font-family: arial;
font-size :14px;
}
@maskingtape
maskingtape / dabblet.css
Created June 6, 2013 08:48
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
div {
width: 190px;
font-size: 62.5%;
font-family: arial;
font-size :14px;
}
@maskingtape
maskingtape / scriptLoader.js
Created March 25, 2013 10:20
HTML5 boilerplate google analytics script loader generalised to include the font loader
var _gaq=[['_setAccount','UA-XXXXXXX-X'],['_trackPageview']],
WebFontConfig = { google: { families: [ 'Marvel::latin' ]}};
(function(d,t){
function addScript(p, url){
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?p.s:p.n)+url;
s.parentNode.insertBefore(g,s);
}
addScript({ s: '//ssl', n: '//www'}, '.google-analytics.com/ga.js');
addScript({ s: 'https', n: 'http'}, '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
@maskingtape
maskingtape / dabblet.css
Created March 21, 2013 14:08
SVG Data URI Background borders
/**
* SVG Data URI Background borders
*/
body{
background: #fff;
min-height: 100%;
font-family: sans-serif;
}
@maskingtape
maskingtape / getEmWidth
Created September 27, 2012 15:18
Finds the width in ems of any string
// Finds the width in ems of any string
// Useful for finding out how wide elements set on the page in ems will be in pixels
function getEmWidth(chars){
var p = document.createElement("span");
p.innerHTML = chars;
document.body.appendChild(p);
var width = p.getBoundingClientRect().width;
document.body.removeChild(p);
return width;
}
@maskingtape
maskingtape / dabblet.css
Created September 27, 2012 13:30
Desaturated background colour/image in firefox/webkit
/**
* Desaturated background colour/image in firefox/webkit
*/
li, a {
margin: 0;
padding: 0;
list-style-type : none;
position:relative;
@maskingtape
maskingtape / dabblet.css
Created September 27, 2012 13:30
Desaturated background colour/image in firefox/webkit
/**
* Desaturated background colour/image in firefox/webkit
*/
li, a {
margin: 0;
padding: 0;
list-style-type : none;
position:relative;
@maskingtape
maskingtape / dabblet.css
Created September 27, 2012 13:28
Two elements, vertical alignment bottom, variable height and width
/**
* Two elements, vertical alignment bottom, variable height and width
*/
header {
display: table;
border-collapse:collapse;
height: 180px;
margin: 0 auto;
}
h1 {