Skip to content

Instantly share code, notes, and snippets.

@ThatGuySam
Created February 2, 2016 20:12
Show Gist options
  • Save ThatGuySam/37eeda0d62e5cd36125c to your computer and use it in GitHub Desktop.
Save ThatGuySam/37eeda0d62e5cd36125c to your computer and use it in GitHub Desktop.
Less Mixin for Ghost Centering https://css-tricks.com/centering-in-the-unknown/
.ghost-center(@className: nothing, @pre: ~'.') {
text-align: center;
&:before {
content: '';
display: inline-block;
font-size: 0;
text-decoration: none;
height: 100%;
vertical-align: middle;
margin-right: -0.25em; /* Adjusts for spacing */
}
> div,
> span,
> .wpb_wrapper,
> .wpb_text_column,
> @{pre}@{className} {
display: inline-block;
vertical-align: middle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment