Sha256: bd681b63d4850114eb7220223f8b83ecd54369703df540d823d635779de9467a
Contents?: true
Size: 884 Bytes
Versions: 10
Compression:
Stored size: 884 Bytes
Contents
// Fetch value from key in map // ------------------------------------------------------------------------------- // @dependence `map-fetche()` // ------------------------------------------------------------------------------- // @param $i [Map] : map // @param $n [Keys...] : keys // ------------------------------------------------------------------------------- // @return [Value] | false @function map-fetch($map, $keys) { $key: nth($keys, 1); $length: length($keys); $value: map-get($map, $key); // check if value equals NULL (meaning the @param was incorrect) // return false so that sass still compiles without errors @if $value == NULL { @return false; } @else { @if $length > 1 { $rest: (); @for $i from 2 through $length { $rest: append($rest, nth($keys, $i)) } @return map-fetch($value, $rest); } @else { @return $value; } } }
Version data entries
10 entries across 10 versions & 1 rubygems