title: Spinner for Twitter Bootstrap .btn
body: <p>Im trying to create spinners for Twitter Bootstrap buttons. Spinners should indicate some work in progress (ie. ajax request).</p>
  
  <p>Here is small example:
  <a href="http://jsfiddle.net/AndrewDryga/zcX4h/1/">http://jsfiddle.net/AndrewDryga/zcX4h/1/</a></p>
  
  <p>HTML (full on jsfiddle):</p>
  
  <pre><code>Unknown element (no animation here!):
  &lt;p&gt;
    &lt;button class="btn-success has-spinner"&gt;
      &lt;span class="spinner"&gt;&lt;i class="icon-spin icon-refresh"&gt;&lt;/i&gt;&lt;/span&gt;
      Foo
    &lt;/button&gt;
  &lt;/p&gt;
  
  Works when width is defined:
  &lt;p&gt;
    &lt;a class="btn btn-success has-spinner"&gt;
      &lt;span class="spinner"&gt;&lt;i class="icon-spin icon-refresh"&gt;&lt;/i&gt;&lt;/span&gt;
      Foo
    &lt;/a&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>CSS: </p>
  
  <pre><code>.spinner {
    display: inline-block;
    opacity: 0;
    width: 0;
  
    -webkit-transition: opacity 0.25s, width 0.25s;
    -moz-transition: opacity 0.25s, width 0.25s;
    -o-transition: opacity 0.25s, width 0.25s;
    transition: opacity 0.25s, width 0.25s;
  }
  
  /* ... */
  
  .has-spinner.active .spinner {
    opacity: 1;
    width: auto; /* This doesn't work, just fix for unkown width elements */
  }
  
  /* ... */
  
  .has-spinner.btn.active .spinner {
      width: 16px;
  }
  
  .has-spinner.btn-large.active .spinner {
      width: 19px;
  }
  </code></pre>
  
  <p>The deal is that css "margin: auto" doesn't produce expected animation and spinner widths for all elements should be defined via css. Is there are any way to solve this problem? Also, maybe there are better way to align/show spinners?</p>
  
  <p>And should i play with buttons padding and make it in way, where button width doesn't change, when spinner is shown or buttons that change width is ok? (If ill put it as snippet somewhere)</p>