When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
# AwesomeRouter: A class that I've been using throughout a few Backbone.js apps I've built. | |
# | |
# It adds 2 features: an event that gets fired when one calls `navigate` (aptly named | |
# "navigate"), so you can bind things to when a URL gets triggered. And a "before filter" | |
# method `before`, which you can use to run things before every a route gets triggered. | |
# | |
# This could easily be extended to have after filters too, or to only trigger a route | |
# upon @before returning something that's not false. | |
class AwesomeRouter extends Backbone.Router |
/** | |
* Vertical centering with Flexbox + margin fallback | |
* Lea Verou & David Storey | |
*/ | |
html, body { height: 100%; } | |
body { | |
width: 100%; /* needed for FF */ | |
margin: 0; |
function lens(get, set) { | |
var f = function (a) { return get(a); }; | |
f.set = set; | |
f.mod = function (f, a) { return set(a, f(get(a))); }; | |
return f; | |
} | |
var first = lens( | |
function (a) { return a[0]; }, | |
function (a, b) { return [b].concat(a.slice(1)); } |
require('footools').setup(Array, Boolean, Function, Number, RegExp, String); | |
"bar".foo(); // no Fail |