Skip to content

Instantly share code, notes, and snippets.

@varyform
Created March 13, 2015 17:11
Show Gist options
  • Save varyform/91997cd61d4fc5d46ca6 to your computer and use it in GitHub Desktop.
Save varyform/91997cd61d4fc5d46ca6 to your computer and use it in GitHub Desktop.
CSS file extension
// usage:
// .file-extension
// %span TXT
body {
background: #f0f0f0;
padding: 2em;
}
.file-extension {
$color: red;
$fold: 15px;
width: 70px;
height: 100px;
background: linear-gradient(-135deg, transparent 0%, transparent $fold * 1.4, $color $fold * 1.4 + 1px, $color 100%);
position: relative;
&:after {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0px;
border: $fold solid;
border-color: transparent transparent rgba(white, .6) rgba(white, .6);
right: 0;
top: 0;
}
&:before {
content: "";
display: block;
position: absolute;
width: 0px;
height: 0px;
border: $fold solid blue;
border-color: darken($color, 15%) darken($color, 15%) transparent transparent;
right: 0;
top: $fold * 2;
}
span {
background: darken($color, 15%);
color: white;
text-transform: capitalize;
position: absolute;
bottom: 5px;
left: -5px;
right: 5px;
padding: 5px 10px;
font-size: 16px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment