Skip to content

Instantly share code, notes, and snippets.

View maxhoffmann's full-sized avatar
👷‍♂️
currently building konsens.it

Max Hoffmann maxhoffmann

👷‍♂️
currently building konsens.it
View GitHub Profile
@maxhoffmann
maxhoffmann / input.sass
Last active December 25, 2015 17:49
Generated by SassMeister.com.
// MIXIN
=when($min: false, $max: false, $ie: false)
@if $min and not($max)
@media (min-width: $min)
@content
@if $max and not($min)
@media (max-width: $max)
@maxhoffmann
maxhoffmann / toCollection.js
Last active December 17, 2015 19:49
Best parameter hinting for a list of elements?
function toCollection(elementOrString) {
return (elementOrString instanceof Element) ? [elementOrString] :
Array.prototype.slice.call((elementOrString instanceof NodeList) ? elementOrString : document.querySelectorAll(elementOrString));
};
.pulled-to-right {
float: right;
width: 50%;
background-image: url(http://www.nasa.gov/images/content/745223main_image04292013_250m_800-600.jpg);
background-size: cover;
height: 30vw;
}
p {
margin-left: 5%;
@maxhoffmann
maxhoffmann / dabblet.css
Created April 30, 2013 12:40
Fixing inline-block + overflow: hidden in Firefox + Opera
/**
* Fixing inline-block + overflow: hidden in Firefox + Opera
*/
.overflow {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
}
@maxhoffmann
maxhoffmann / dabblet.css
Created April 30, 2013 12:08
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.overflow {
max-width: 100%;
overflow: hidden;
white-space: nowrap;
}
@maxhoffmann
maxhoffmann / dabblet.css
Created March 9, 2013 19:25
Clearing floats with overflow: auto
/**
* Clearing floats with overflow: auto
*/
.bg {
background: red;
}
.cf {
overflow: auto;
}
@maxhoffmann
maxhoffmann / dabblet.css
Created February 27, 2013 14:10
CSS only tooltip
/**
* CSS only tooltip
*/
.tooltip:hover {
position: relative;
}
.tooltip:before,
.tooltip:after {
@maxhoffmann
maxhoffmann / dabblet.css
Created February 27, 2013 09:01
Micro Clearfix IE8+
/**
* Micro Clearfix IE8+
*/
.box {
width: 100px;
height: 100px;
background: gray;
padding: 20px;
@maxhoffmann
maxhoffmann / dabblet.css
Created February 14, 2013 14:43
Moving arrow navigation with CSS only
/**
* Moving arrow navigation with CSS only
*/
ul {
position: relative;
margin: 3em 0;
list-style: none;
}
@maxhoffmann
maxhoffmann / dabblet.css
Created February 8, 2013 13:29
_nav without clearfix
/**
* _nav without clearfix
*/
.nav{
list-style:none;
margin-left:0;
}
.nav > li,