Skip to content

Instantly share code, notes, and snippets.

@elseloop
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save elseloop/bc3fb20d783e6f54ab9d to your computer and use it in GitHub Desktop.

Select an option

Save elseloop/bc3fb20d783e6f54ab9d to your computer and use it in GitHub Desktop.
Ghost Element mixin
// @include on parent element
// $child should be a selector passed as a string, ie: ".child"
// example usage: http://codepen.io/elseloop/pen/Kkhmo/
@mixin ghost( $child, $child-width ) {
&:before {
content: '';
display: inline-block;
vertical-align: middle;
height: 100%;
margin-right: -.25rem;
}
#{$child} {
display: inline-block;
width: $child-width;
vertical-align: middle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment