ribbon.css 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*!
  2. * "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License
  3. * https://github.com/simonwhitaker/github-fork-ribbon-css
  4. */
  5. /* Left will inherit from right (so we don't need to duplicate code) */
  6. .github-fork-ribbon {
  7. /* The right and left classes determine the side we attach our banner to */
  8. position: absolute;
  9. /* Add a bit of padding to give some substance outside the "stitching" */
  10. padding: 2px 0;
  11. /* Set the base colour */
  12. background-color: #a00;
  13. /* Set a gradient: transparent black at the top to almost-transparent black at the bottom */
  14. background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15)));
  15. background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  16. background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  17. background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  18. background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  19. background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  20. /* Add a drop shadow */
  21. -webkit-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
  22. -moz-box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
  23. box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5);
  24. /* Set the font */
  25. font: 700 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
  26. z-index: 9999;
  27. pointer-events: auto;
  28. }
  29. .github-fork-ribbon a,
  30. .github-fork-ribbon a:hover {
  31. /* Set the text properties */
  32. color: #fff;
  33. text-decoration: none;
  34. text-shadow: 0 -1px rgba(0, 0, 0, 0.5);
  35. text-align: center;
  36. /* Set the geometry. If you fiddle with these you'll also need
  37. to tweak the top and right values in .github-fork-ribbon. */
  38. width: 200px;
  39. line-height: 20px;
  40. /* Set the layout properties */
  41. display: inline-block;
  42. padding: 2px 0;
  43. /* Add "stitching" effect */
  44. border-width: 1px 0;
  45. border-style: dotted;
  46. border-color: #fff;
  47. border-color: rgba(255, 255, 255, 0.7);
  48. }
  49. .github-fork-ribbon-wrapper {
  50. width: 150px;
  51. height: 150px;
  52. position: absolute;
  53. overflow: hidden;
  54. top: 0;
  55. z-index: 9999;
  56. pointer-events: none;
  57. }
  58. .github-fork-ribbon-wrapper.fixed {
  59. position: fixed;
  60. }
  61. .github-fork-ribbon-wrapper.left {
  62. left: 0;
  63. }
  64. .github-fork-ribbon-wrapper.right {
  65. right: 0;
  66. }
  67. .github-fork-ribbon-wrapper.left-bottom {
  68. position: fixed;
  69. top: inherit;
  70. bottom: 0;
  71. left: 0;
  72. }
  73. .github-fork-ribbon-wrapper.right-bottom {
  74. position: fixed;
  75. top: inherit;
  76. bottom: 0;
  77. right: 0;
  78. }
  79. .github-fork-ribbon-wrapper.right .github-fork-ribbon {
  80. top: 42px;
  81. right: -43px;
  82. -webkit-transform: rotate(45deg);
  83. -moz-transform: rotate(45deg);
  84. -ms-transform: rotate(45deg);
  85. -o-transform: rotate(45deg);
  86. transform: rotate(45deg);
  87. }
  88. .github-fork-ribbon-wrapper.left .github-fork-ribbon {
  89. top: 42px;
  90. left: -43px;
  91. -webkit-transform: rotate(-45deg);
  92. -moz-transform: rotate(-45deg);
  93. -ms-transform: rotate(-45deg);
  94. -o-transform: rotate(-45deg);
  95. transform: rotate(-45deg);
  96. }
  97. .github-fork-ribbon-wrapper.left-bottom .github-fork-ribbon {
  98. top: 80px;
  99. left: -43px;
  100. -webkit-transform: rotate(45deg);
  101. -moz-transform: rotate(45deg);
  102. -ms-transform: rotate(45deg);
  103. -o-transform: rotate(45deg);
  104. transform: rotate(45deg);
  105. }
  106. .github-fork-ribbon-wrapper.right-bottom .github-fork-ribbon {
  107. top: 80px;
  108. right: -43px;
  109. -webkit-transform: rotate(-45deg);
  110. -moz-transform: rotate(-45deg);
  111. -ms-transform: rotate(-45deg);
  112. -o-transform: rotate(-45deg);
  113. transform: rotate(-45deg);
  114. }