Skip to content

Instantly share code, notes, and snippets.

@philzelnar
Last active November 27, 2017 20:30
Show Gist options
  • Save philzelnar/1f67e48fba99e9c06e81dabaf62ae5dd to your computer and use it in GitHub Desktop.
Save philzelnar/1f67e48fba99e9c06e81dabaf62ae5dd to your computer and use it in GitHub Desktop.
A sass mixin to reset CSS on an element. Three options to pass in: spacing, list, or everything.
// Quick CSS Resets for Sass
//
// .example {
// @include reset(spacing);
// }
@mixin reset($type: null) {
@if $type == spacing { margin: 0; padding: 0; }
@if $type == list { margin: 0; padding: 0; list-style: none;
& li { margin: 0; padding: 0; }
}
@if $type == everything { float: none; position: static; height: auto; width: auto; margin: 0; padding: 0; background-color: transparent; border: none; list-style: none; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment