Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reuse a class in sass without using a mixin? [duplicate]

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.

like image 537
sites Avatar asked Jul 09 '12 17:07

sites


People also ask

What is the difference between mixin and extend in Sass?

@mixin is used to group css code that has to be reused a no of times. Whereas the @extend is used in SASS to inherit(share) the properties from another css selector. @extend is most useful when the elements are almost same or identical. The main difference between the two is in their compiled CSS file.


1 Answers

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.

like image 172
wisew Avatar answered Sep 18 '22 04:09

wisew