Skip to content

Instantly share code, notes, and snippets.

@heyMP
Created February 10, 2014 21:39
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 heyMP/8924727 to your computer and use it in GitHub Desktop.
Save heyMP/8924727 to your computer and use it in GitHub Desktop.
Child Margin Fixer. This will remove the margin on the first child and last child elements within a selector. Mainly used for lists.
@mixin child-margin-fixer {
& > *:first-child,
& > *:last-child,
& > *:last-child > *:last-child,
& > *:last-child > *:last-child > *:last-child {
margin: 0;
}
}
@heyMP
Copy link
Author

heyMP commented Feb 10, 2014

I need to change this a bit. Plan on adding a 'selector' and 'depth' variable

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