1

I created a function to produce variable by using 2 function's parameters. Here is the functions:

@function set-preset-color($presetID: 0 , $colorID: 1){
    $preset_str : tpl_pre_#{$presetID}_color_#{$colorID};
    @return $preset_str;
}

It works correctly. But the question is how I can convert the string which is gerenated by this function to variable? For example the function returns the "tpl_pre_0_color_1" by default, but I need "$tpl_pre_0_color_1" for using it in other parts of my project!

Please let me know your solution.

Joseph_a
  • 11
  • 2
  • 1
    Don't think it's possible. But as noted [here](http://krasimirtsonev.com/blog/article/SASS-interpolation-in-a-name-of-variable-nest-variables-within-variables) it can be achieved with placeholders. Any reason why an array approach doesn't work? – KnutSv Jun 20 '14 at 12:02

0 Answers0