Last active
December 20, 2015 12:39
-
-
Save mike-zarandona/6132926 to your computer and use it in GitHub Desktop.
The .ticket-punch() mix-in allows for very easy creation of "punchouts" on the left and right side of an element using :before and :after pseudo-elements.
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
.ticket(@size: 11px, @bgColor: #fff, @borderStyle: solid, @borderWidth: 1px, @borderColor: #333) { | |
position: relative; | |
border: @borderStyle @borderWidth @borderColor; | |
text-align: center; | |
padding: 10px 20px; | |
display: inline-block; | |
&:before { | |
position: absolute; | |
content: ''; | |
width: @size; | |
height: @size; | |
background-color: @bgColor; | |
border-radius: 50%; | |
left: (@size / 2 * -1); | |
top: 50%; | |
margin-top: (@size / 2 * -1); | |
border-right: @borderStyle @borderWidth @borderColor; | |
} | |
&:after { | |
position: absolute; | |
content: ''; | |
width: @size; | |
height: @size; | |
background-color: @bgColor; | |
border-radius: 50%; | |
right: (@size / 2 * -1); | |
top: 50%; | |
margin-top: (@size / 2 * -1); | |
border-left: @borderStyle @borderWidth @borderColor; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment