1313/// @example
1414/// @include poly-fluid-sizing('font-size', (576px: 22px, 768px: 24px, 992px: 34px));
1515/// @author Jake Wilson <jake.e.wilson@gmail.com >
16- @mixin poly-fluid-sizing ($property , $map ) {
16+ @mixin poly-fluid-sizing ($properties , $map ) {
1717 // Get the number of provided breakpoints
1818 $length : length (map-keys ($map ));
1919
2626 $map : map-sort($map );
2727 $keys : map-keys ($map );
2828
29- // Minimum size
30- #{$property } : map-get ($map , nth ($keys ,1 ));
29+ @each $property in $properties {
30+ // Minimum size
31+ #{$property } : map-get ($map , nth ($keys ,1 ));
3132
32- // Interpolated size through breakpoints
33- @for $i from 1 through ($length - 1 ) {
34- @media (min-width :nth ($keys ,$i )) {
35- $value1 : map-get ($map , nth ($keys ,$i ));
36- $value2 : map-get ($map , nth ($keys ,($i + 1 )));
37- // If values are not equal, perform linear interpolation
38- @if ($value1 != $value2 ) {
39- #{$property } : linear-interpolation ((nth ($keys ,$i ): $value1 , nth ($keys ,($i + 1 )): $value2 ));
40- } @else {
41- #{$property } : $value1 ;
33+ // Interpolated size through breakpoints
34+ @for $i from 1 through ($length - 1 ) {
35+ @media (min-width :nth ($keys ,$i )) {
36+ $value1 : map-get ($map , nth ($keys ,$i ));
37+ $value2 : map-get ($map , nth ($keys ,($i + 1 )));
38+ // If values are not equal, perform linear interpolation
39+ @if ($value1 != $value2 ) {
40+ #{$property } : linear-interpolation ((nth ($keys ,$i ): $value1 , nth ($keys ,($i + 1 )): $value2 ));
41+ } @else {
42+ #{$property } : $value1 ;
43+ }
4244 }
4345 }
44- }
4546
46- // Maxmimum size
47- @media (min-width :nth ($keys ,$length )) {
48- #{$property } : map-get ($map , nth ($keys ,$length ));
47+ // Maxmimum size
48+ @media (min-width :nth ($keys ,$length )) {
49+ #{$property } : map-get ($map , nth ($keys ,$length ));
50+ }
4951 }
5052}
0 commit comments