This is now an actual repo:
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
// Maintain ratio mixin. Great for responsive grids, or videos. | |
// https://gist.github.com/brianmcallister/2932463 | |
// | |
// $ratio - Ratio the element needs to maintain. | |
// | |
// Examples | |
// | |
// // A 16:9 ratio would look like this: | |
// .element { | |
// @include maintain-ratio(16 9); |
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
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013 Thom Seddon | |
* Copyright (c) 2010 Google | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
/** | |
* The pseudo-element 'content' property doesnt accept normal (») style | |
* HTML entities. These variables below easy the pain of looking up the HEX codes... | |
* | |
* Referenced from http://www.danshort.com/HTMLentities/ | |
* | |
* TODO: Add all the other entities? Worth it? Some day? Maybe? | |
*/ | |
// Punctuation |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
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 interpolate($properties, $min-screen, $max-screen, $min-value, $max-value) { | |
& { | |
@each $property in $properties { | |
#{$property}: $min-value; | |
} | |
@media screen and (min-width: $min-screen) { | |
@each $property in $properties { | |
#{$property}: calc-interpolation($min-screen, $min-value, $max-screen, $max-value); | |
} |