Last active
December 10, 2018 17:43
-
-
Save rolandcoops/21f14bc103500b4cededb989c349e895 to your computer and use it in GitHub Desktop.
Speech arrow 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
@mixin with-speech-arrow ( | |
$align: left, | |
$size: 20px, | |
$border-color: #eee | |
) { | |
&:before, | |
&:after { | |
content: ''; | |
position: absolute; | |
border-color: transparent; | |
border-style: solid; | |
border-top: 0; | |
} | |
// speech arrow border (actually the bottom of two fill-shapes) | |
&:before { | |
top: -$size; | |
#{$align}: $size; | |
border-width: $size; | |
border-bottom-color: $border-color; | |
} | |
// speech arrow fill (rendered on top of the ‘border’ fill-shape) | |
&:after { | |
top: -$size + 1px; | |
#{$align}: $size + 1px; | |
border-width: $size - 1px; | |
border-bottom-color: $white; // should clip main shape’s border with that shape’s background colour… | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment