This file contains 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
// child.html | |
let height; | |
const sendPostMessage = () => { | |
if (height !== document.getElementById('container').offsetHeight) { | |
height = document.getElementById('container').offsetHeight; | |
window.parent.postMessage({ | |
frameHeight: height | |
}, '*'); | |
console.log(height); | |
} |
This file contains 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 break-min($min) { | |
@media only screen and (min-width: $min) { | |
@content; | |
} | |
} | |
@mixin break-max($max) { | |
@media only screen and (max-width: $max - 1px) { | |
@content; | |
} |
This file contains 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
function timeDifference(current, previous) { | |
const milliSecondsPerMinute = 60 * 1000 | |
const milliSecondsPerHour = milliSecondsPerMinute * 60 | |
const milliSecondsPerDay = milliSecondsPerHour * 24 | |
const milliSecondsPerMonth = milliSecondsPerDay * 30 | |
const milliSecondsPerYear = milliSecondsPerDay * 365 | |
const elapsed = current - previous |
This file contains 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
// CSS Grid | |
@mixin gridcontainer($columns: $site-columns, $rows:false, $gutter: false, $guttertype: "padding") { | |
display: -ms-grid; | |
display: grid; | |
// TODO: make the ms declaration a loop based on colums. -LR | |
-ms-grid-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; | |
grid-template-columns: repeat($site-columns, 1fr) ; | |
@include container($guttertype); |
This file contains 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 break-min($min) { | |
@media only screen and (min-width: $min) { | |
@content; | |
} | |
} | |
@mixin break-max($max) { | |
@media only screen and (max-width: $max - 1px) { | |
@content; | |
} |
This file contains 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 fontsize($font-size, $line-height:false) { | |
$size: strip-unit($font-size); | |
font-size: #{$size}px; | |
font-size: #{$size/strip-unit($base-font-size)}rem; | |
@if $line-height { | |
// line-height:ceil($font-size / $base-line-height) * ($base-line-height / $font-size); | |
line-height: $line-height; |
This file contains 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 responsive-header($size-min, $size-max, $lineheight:false, $marginbottom:false, $breakMinTypoWidth:$break-min-typo-width, $breakMaxTypoWidth:$break-max-typo-width, $font-weight:bold ) { | |
$breakmin: strip-unit($breakMinTypoWidth); | |
$breakmax: strip-unit($breakMaxTypoWidth); | |
@include font-size($size-min); | |
@include break-sliding-typo-size($size-min, $size-max, $breakmin, $breakmax); | |
@media only screen and (min-width: #{$breakmax}px - 1px) { | |
font-size: #{$size-max}px; | |
} |
This file contains 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
// From https://css-tricks.com/snippets/sass/strip-unit-function/ | |
@function strip-unit($number) { | |
@if type-of($number) == 'number' and not unitless($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
@return $number; | |
} |
This file contains 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
return arr.reduce(function(acc, curr) { | |
return acc > curr ? acc : curr; | |
}); |
This file contains 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
var max = Math.max.apply(null, numbers); |