Skip to content

Instantly share code, notes, and snippets.

@josephhinson
Created November 18, 2013 17:46
Show Gist options
  • Select an option

  • Save josephhinson/7532083 to your computer and use it in GitHub Desktop.

Select an option

Save josephhinson/7532083 to your computer and use it in GitHub Desktop.
CSS Folding triangle from corner of any element
.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