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
import { decode } from "blurhash" | |
export function blurHashToDataURL(hash: string | undefined): string | undefined { | |
if (!hash) return undefined | |
const pixels = decode(hash, 32, 32) | |
const dataURL = parsePixels(pixels, 32, 32) | |
return dataURL | |
} |
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
// ----------------------------------------------------------------------------- | |
// @author Zakir Tariverdiev | |
// @created August 2, 2014 | |
// @desc Sass mixin that provides convenient way to style element's siblings. | |
// Based on the example from Lea Verou's blog: | |
// http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/ | |
// @param (string) $sibling-count - number of expected siblings. You can also use | |
// use such forms as "n + 3" and "3n" for "at least 3 siblings" and | |
// "siblings divisible by 3," for example. These forms must be enclosed in | |
// quotes for proer parsing though. |