Skip to content

Instantly share code, notes, and snippets.

*{
margin:0;
padding:0;
border:0;
box-sizing: border-box
}
html, body{
height:100%;
width:100%;
@Joopmicroop
Joopmicroop / chrome snippets
Created April 23, 2014 12:55
chrome snippets
/*
Will show in the console which stylesheets are enabled/disabled
*/
console.group('stylesheet enabled/disabled')
for(var i=0;i<document.styleSheets.length; i++){
console.log(document.styleSheets[i].disabled?'disabled':'enabled', document.styleSheets[i].href)
}
console.groupEnd();
@Joopmicroop
Joopmicroop / Helper functions
Last active November 13, 2019 10:36
dom helper functions
function CssHelper(){
// checkers
this.isPx = function isPx(v){ return /px/gi.test(v); };
this.isPc = function isPc(v){ return /%|pc/gi.test(v); };
this.isVal = function isVal(v){ return !isNaN(v); };
// converters
this.toVal = function toVal(v){ return parseFloat(v); };
this.toUnit = function toUnit(unit, v){ return this.toVal(v)+unit; };
this.toPx = this.toUnit.bind(this, 'px');
this.toPc = this.toUnit.bind(this, '%');