This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin spacer($val, $type:'padding', $scale: 2) { | |
// Usage: | |
// @include spacer(10px 2em 100vh, margin, 4); | |
// or | |
// @include spacer(10px 2em 100vh); | |
@if $val != 0 and $val != false { | |
$keys: top left bottom right; | |
$vals: 0 0 0 0; | |
@if length($val) == 1 { | |
$vals: $val $val $val $val; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use: ><a href="list.html" class="js-back">Go back</a> | |
$('.js-back').on('click', function(evt) { | |
if (document.referrer != "") { | |
evt.preventDefault(); | |
history.back(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prevent images from disrupting vertical flow | |
$(window).resize(function() { | |
var fontSize = parseInt($('body').css('font-size'),0);; | |
var lineHeight = parseInt($('body').css('line-height'),0);; | |
$('.baseline').each(function() { | |
var heightDif = $(this).outerHeight(); | |
$(this).css('margin-bottom', fontSize + heightDif % lineHeight); | |
}); | |
}); | |
$('.baseline').load(function() { $(window).resize(); }); |