title: Sass - Setting variables with variables
body: <p>I'm looking to get a solid answer on whether it's possible to reference variables based on the value of another variable. This is possible in PHP (among others).</p>
  
  <p>Example (in Sass):</p>
  
  <p>I want to set the border-color to $green (or $blue, $yellow, etc), which are variables being included from a partial. I am looping through a list of color names like such:</p>
  
  <pre><code>$colors = green, yellow, blue; 
  
  @each $c in $colors {
  &amp;.#{$c} {
      border-color: $#{$c};
      }
  }
  </code></pre>
  
  <p>The above code (ideally) generates classes for .green, .yellow, and .blue, each with a border-color set to $green, $yellow or $blue, respectively.</p>
  
  <p>(Obviously) the above code is not working, but is there another way of achieving this in Sass/Compass?</p>