Blocss/blocss

value list in rem mixin

hulsbosch opened this issue · 1 comments

Here's an idea:

    @mixin rem($property, $value, $include-fallback: true){
        @if $include-fallback == true{
            #{$property}: $value;
        }
        @if type-of($value) == list{
            // code to export $value to rem units when $value is a list. E.g. 0 0 10px 10px.
        }
        @else{
            #{$property}: $value/$base-font-size*1rem;
        }
    }

Checkit:

    @mixin rem($property, $values..., $include-fallback: true){
        @if $include-fallback == true{
            #{$property}: $values;
        }
        @if type-of($values) == list{
            $all: ();
            @for $i from 1 through length($values){
                $all: append(nth($values, $i)/$base-font-size*1rem);
            }
            #{$property}: $all;
        }
        @else{
            #{$property}: $values/$base-font-size*1rem;
        }
    }