Created
February 9, 2016 17:00
-
-
Save taniarascia/c7f87847b4ed3086c691 to your computer and use it in GitHub Desktop.
Inline block mixin
This file contains 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
@mixin inline-block-lr($container,$left,$right){ | |
#{$container}{ | |
text-align: justify; | |
&:after{ | |
content: ''; | |
display: inline-block; | |
width: 100%; | |
height: 0; | |
font-size:0; | |
line-height:0; | |
} | |
} | |
#{$left} { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
#{$right} { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
} | |
It accepts 3 parameters. The container, the left and the right element. For example, to fit the question, you could use it like this: | |
@include inline-block-lr('header', 'h1', 'nav'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment