Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. @function get( $args... ) {
  2.  
  3. $length : length( $args );
  4.  
  5. @if( $length >= 2 ) {
  6.  
  7. $map : nth( $args, 1 );
  8.  
  9. @for $i from 2 through $length {
  10.  
  11. $item : nth( $args, $i );
  12.  
  13. @if( type-of( $map ) == map ) {
  14.  
  15. @if( map-has-key( $map, $item ) ) {
  16.  
  17. $map : map-get( $map, $item );
  18.  
  19. }
  20.  
  21. @else {
  22. @warn "Unfortunately, no value could be retrieved from `#{$item}`. "
  23. + "Please make sure it is defined in `$map` map.";
  24. }
  25.  
  26. }
  27.  
  28. }
  29.  
  30. @return $map;
  31. }
  32.  
  33. @else {
  34. @warn "Not enough arguments.";
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement