Last active
December 16, 2015 17:09
-
-
Save sixFingers/5467996 to your computer and use it in GitHub Desktop.
A simple scss mixin to render a tooltipped-box.
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
@mixin tooltip($background, $borderColor) { | |
position: relative; | |
background: $background; | |
border: 1px solid $borderColor; | |
&:after { | |
content: ""; | |
display: block; | |
position: absolute; | |
left: 50%; | |
margin-left: -10px; | |
top: -19px; | |
border-top: 10px solid transparent; | |
border-bottom: 10px solid $background; | |
border-left: 10px solid transparent; | |
border-right: 10px solid transparent; | |
} | |
&:before { | |
content: ""; | |
display: block; | |
position: absolute; | |
left: 50%; | |
margin-left: -10px; | |
top: -20px; | |
border-top: 10px solid transparent; | |
border-bottom: 10px solid $borderColor; | |
border-left: 10px solid transparent; | |
border-right: 10px solid transparent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment