Skip to content

Instantly share code, notes, and snippets.

@trey
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trey/76a01bb16320b8450934 to your computer and use it in GitHub Desktop.
Save trey/76a01bb16320b8450934 to your computer and use it in GitHub Desktop.
@extend versus @mixin

From Sass for Web Designers:

Where a mixin will write the same rules in each declaration it’s called from, @extend will create multiple, comma-separated selectors for shared styles. It’s good to keep that difference in mind when you’re debating which to use

Also remember that @extend is to apply the same rules to different elements while a @mixin can do that plus act as a function that you can pass arguments to. Cedarholm's opinion is that you shoud consider what the CSS output will look like when determining which one to use.

@trey
Copy link
Author

trey commented May 13, 2014

This is a Solutions Log post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment