title: SASS Mixin with optional and variable parameters
body: <p>Is there a way to use both optional and variable elements in a sass mixin?</p>
  
  <p>i try </p>
  
  <pre><code>@mixin name($className,  $centered: false, $dimension...)
  </code></pre>
  
  <p>but the first dimension value is assigned to <code>$centered</code></p>
  
  <p>switching parameters order don't compile</p>
  
  <pre><code>@mixin name($className, $dimension..., $centered: false )
  </code></pre>
  
  <p>the error is:</p>
  
  <pre><code>SASSInvalid CSS after "..., $dimension...": expected ")", was ", $centered: fa..."
  </code></pre>
  
  <p>since the mixin without the optional parameter is used in many place (over 70) i dont want yo change it all to add the new parameters, so i want to leave it optional?</p>
  
  <p>Any way to change this mixin or i have to leave the original without <code>$centered</code> and create an ovverride with the new parameter?</p>
  
  <p>for info this is the mixin body:</p>
  
  <pre><code>    @for $i from 1 through length($dimension){                              
          @if($centered) {
              .#{$className}Td#{$i}, .#{$className}Th#{$i}  { 
                  width: nth($dimension, $i); 
                  text-align:center;
              }
          }
          @else{
              .#{$className}Td#{$i}, .#{$className}Th#{$i} {width: nth($dimension, $i); }
          }
      }
  </code></pre>
  
  <p>EDIT with complete cowking example:</p>
  
  <p>simply iam defining css for column width of my table in a faster way, so this</p>
  
  <p>@include nome("columnsName", 40%, 30%, 30%);</p>
  
  <p>is rendered in that way:</p>
  
  <pre><code>.columnsNameTd1, .columnsNameTh1{width: 40%;}
  
  .columnsNameTd2, .columnsNameTh2{ width: 30%; }
  
  .columnsNameTd3, .columnsNameTh3{ width: 30%;}
  </code></pre>
  
  <p>i want a way to text-align center all my columns, maybe can be interesting see if there is a way do to specify what column to center, making all other left by default</p>