Created
March 13, 2015 17:11
-
-
Save varyform/91997cd61d4fc5d46ca6 to your computer and use it in GitHub Desktop.
CSS file extension
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
// 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