Created
November 18, 2013 17:46
-
-
Save josephhinson/7532083 to your computer and use it in GitHub Desktop.
CSS Folding triangle from corner of any element
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
| .triangleFold(@size, @basebackground, @foldcolor) { | |
| &:after { | |
| content: ''; | |
| width: 0; | |
| height: 0; | |
| border-left: @size solid transparent; | |
| border-right: 0px solid transparent; | |
| border-bottom: @size solid @basebackground; | |
| position: absolute; | |
| bottom: 0px; | |
| right: 0px; | |
| } | |
| &:before { | |
| content: ''; | |
| width: 0; | |
| height: 0; | |
| border-top: @size solid @foldcolor; | |
| border-left: 0px solid transparent; | |
| border-right: @size solid transparent; | |
| position: absolute; | |
| bottom: 0px; | |
| right: 0px; | |
| } | |
| } | |
| // Use as follows: | |
| div.trianglefold { | |
| .triangleFold(12px, @basebackground, @foldcolor); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment