1@function match($list, $icon) { 2 @each $item in $list { 3 $index: index($item, $icon); 4 @if $index { 5 $return: if($index == 1, 2, $index); 6 @return nth($item, $return); 7 } 8 } 9 @return false; 10} 11 12@mixin i($icon) { 13 .#{$icon}.icon-left a:before, 14 .#{$icon}.icon-right a:after, 15 i.#{$icon}:before { 16 content: "#{match($entypo-icons, $icon)}"; 17 height: inherit; 18 } 19} 20 21@mixin icon($icon) { 22 @if (type-of($icon) == list) { 23 @each $i in $icon { 24 @include i($i); 25 } 26 } 27 @elseif ($icon == all) { 28 @each $icon in $entypo-icons { 29 @include i(nth($icon, 1)); 30 } 31 } 32 @else { 33 @include i($icon); 34 } 35} 36