I
I
igor11122018-12-04 19:26:54
Sass
igor1112, 2018-12-04 19:26:54

Passing a property as a mixin parameter?

How to make it work?

@mixin calc-size($size, $property) {
  $property: $size+px;
}

Usage example:
p {
   @include calc-size(16, font-size);
}
div {
    @include calc-size(200, width);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2018-12-04
@igor1112

sass-lang.com/documentation/file.SASS_REFERENCE.ht... Replace
$property with #{$property}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question