title: SCSS / SASS - Dynamic generation of CSS classes
body: <p>I just came upon a situation where I wanted to automatically generate a series of css classes with help of a mixin. So I was wondering if there is a way to make this dynamically.</p>
  
  <p>Basically I have classes like</p>
  
  <pre><code>.tile-1, .tile-2, .tile-3, .tile-4 ...
  </code></pre>
  
  <p>Where tile-2 is double the height of tile-1, tile-3 three times the height of tile-1, and so on</p>
  
  <p>I also created a very simple mixin to be able to set the base-height in a scss variable and calculate it from there:</p>
  
  <pre><code>@mixin tile-height($size) {
      height: $size * $tile-height;
  }
  </code></pre>
  
  <p>Where <code>$tile-height</code> is being loaded from another scss file.</p>
  
  <p>Is there a way to generate my tile-x classes dynamically in the stylesheet, using the number from the classname as a mixin parameter?</p>