Last active
August 29, 2015 14:03
-
-
Save elseloop/bc3fb20d783e6f54ab9d to your computer and use it in GitHub Desktop.
Ghost Element mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @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