How to reuse a class in sass without using a mixin?

sites picture sites · Jul 9, 2012 · Viewed 30.9k times · Source

I want all my anchors in my application look like .btn (Twitter Bootstrap class), is there a way to make this?

I did

a{
  @include btn;
}

but it does not work because btn should be a mixin, and it's a Twitter Bootstrap class.

Answer

wisew picture wisew · Jul 11, 2012

You want to use @extend .btn; - @extend allows you to inherit all the properties of a selector without having to define it as a mixin.