gh-fork-ribbon.scss (3539B)
1 /*! 2 * "Fork me on GitHub" CSS ribbon v0.2.2 | MIT License 3 * https://github.com/simonwhitaker/github-fork-ribbon-css 4 */ 5 6 .github-fork-ribbon { 7 width: 12.1em; 8 height: 12.1em; 9 position: absolute; 10 overflow: hidden; 11 top: 0; 12 right: 0; 13 z-index: 9999; 14 pointer-events: none; 15 font-size: 13px; 16 text-decoration: none; 17 text-indent: -999999px; 18 } 19 20 .github-fork-ribbon.fixed { 21 position: fixed; 22 } 23 24 .github-fork-ribbon:hover, .github-fork-ribbon:active { 25 background-color: rgba(0, 0, 0, 0.0); 26 } 27 28 .github-fork-ribbon:before, .github-fork-ribbon:after { 29 /* The right and left classes determine the side we attach our banner to */ 30 position: absolute; 31 display: block; 32 width: 15.38em; 33 height: 1.54em; 34 35 top: 3.23em; 36 right: -3.23em; 37 38 -webkit-box-sizing: content-box; 39 -moz-box-sizing: content-box; 40 box-sizing: content-box; 41 42 -webkit-transform: rotate(45deg); 43 -moz-transform: rotate(45deg); 44 -ms-transform: rotate(45deg); 45 -o-transform: rotate(45deg); 46 transform: rotate(45deg); 47 } 48 49 .github-fork-ribbon:before { 50 content: ""; 51 52 /* Add a bit of padding to give some substance outside the "stitching" */ 53 padding: .38em 0; 54 55 /* Set the base colour */ 56 background-color: #a00; 57 58 /* Set a gradient: transparent black at the top to almost-transparent black at the bottom */ 59 background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15))); 60 background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 61 background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 62 background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 63 background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 64 background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15)); 65 66 /* Add a drop shadow */ 67 -webkit-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5); 68 -moz-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5); 69 box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5); 70 71 pointer-events: auto; 72 } 73 74 .github-fork-ribbon:after { 75 /* Set the text from the data-ribbon attribute */ 76 content: attr(data-ribbon); 77 78 /* Set the text properties */ 79 color: #fff; 80 font: 700 1em "Helvetica Neue", Helvetica, Arial, sans-serif; 81 line-height: 1.54em; 82 text-decoration: none; 83 text-shadow: 0 -.08em rgba(0, 0, 0, 0.5); 84 text-align: center; 85 text-indent: 0; 86 87 /* Set the layout properties */ 88 padding: .15em 0; 89 margin: .15em 0; 90 91 /* Add "stitching" effect */ 92 border-width: .08em 0; 93 border-style: dotted; 94 border-color: #fff; 95 border-color: rgba(255, 255, 255, 0.7); 96 } 97 98 .github-fork-ribbon.left-top, .github-fork-ribbon.left-bottom { 99 right: auto; 100 left: 0; 101 } 102 103 .github-fork-ribbon.left-bottom, .github-fork-ribbon.right-bottom { 104 top: auto; 105 bottom: 0; 106 } 107 108 .github-fork-ribbon.left-top:before, .github-fork-ribbon.left-top:after, .github-fork-ribbon.left-bottom:before, .github-fork-ribbon.left-bottom:after { 109 right: auto; 110 left: -3.23em; 111 } 112 113 .github-fork-ribbon.left-bottom:before, .github-fork-ribbon.left-bottom:after, .github-fork-ribbon.right-bottom:before, .github-fork-ribbon.right-bottom:after { 114 top: auto; 115 bottom: 3.23em; 116 } 117 118 .github-fork-ribbon.left-top:before, .github-fork-ribbon.left-top:after, .github-fork-ribbon.right-bottom:before, .github-fork-ribbon.right-bottom:after { 119 -webkit-transform: rotate(-45deg); 120 -moz-transform: rotate(-45deg); 121 -ms-transform: rotate(-45deg); 122 -o-transform: rotate(-45deg); 123 transform: rotate(-45deg); 124 }