Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @function get( $args... ) {
- $length : length( $args );
- @if( $length >= 2 ) {
- $map : nth( $args, 1 );
- @for $i from 2 through $length {
- $item : nth( $args, $i );
- @if( type-of( $map ) == map ) {
- @if( map-has-key( $map, $item ) ) {
- $map : map-get( $map, $item );
- }
- @else {
- @warn "Unfortunately, no value could be retrieved from `#{$item}`. "
- + "Please make sure it is defined in `$map` map.";
- }
- }
- }
- @return $map;
- }
- @else {
- @warn "Not enough arguments.";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement