lfzawacki/musical-artifacts

View on GitHub
app/assets/stylesheets/ribbon.scss

Summary

Maintainability
Test Coverage
/*!
 * Forked from the "Fork me on GitHub" CSS ribbon v0.1.1 | MIT License
 * https://github.com/simonwhitaker/github-fork-ribbon-css
*/

/* Left will inherit from right (so we don't need to duplicate code) */
.ribbon {
  /* The right and left classes determine the side we attach our banner to */
  position: absolute;

  /* Add a bit of padding to give some substance outside the "stitching" */
  padding: 2px 0;

  /* Set the base colour */
  background-color: $hot;
  opacity: 0.75;

  z-index: 2;
  pointer-events: auto;
}

.ribbon span,
.ribbon span:hover {
  /* Set the text properties */
  color: $darker;
  text-decoration: none;
  /*text-shadow: 0 -1px rgba(0, 0, 0, 0.5);*/
  text-align: center;

  /* Set the geometry. If you fiddle with these you'll also need
     to tweak the top and right values in .ribbon. */
  width: 160px;
  line-height: 10px;

  /* Set the layout properties */
  display: inline-block;
  padding: 2px 0;

  /* Add "stitching" effect */
/*  border-width: 1px 0;
  border-style: dotted;
  border-color: #fff;
  border-color: rgba(255, 255, 255, 0.7);*/
}

.ribbon-wrapper {
  width: 150px;
  height: 150px;
  position: absolute;
  overflow: hidden;
  top: 0;
  z-index: 2;
  pointer-events: none;
}

.ribbon-wrapper.fixed {
  position: fixed;
}

.ribbon-wrapper.left {
  left: 0;
}

.ribbon-wrapper.right {
  right: 0;
}

.ribbon-wrapper.left-bottom {
  position: fixed;
  top: inherit;
  bottom: 0;
  left: 0;
}

.ribbon-wrapper.right-bottom {
  position: fixed;
  top: inherit;
  bottom: 0;
  right: 0;
}

.ribbon-wrapper.right .ribbon {
  top: 26px;
  right: -43px;

  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
} 

.ribbon-wrapper.left .ribbon {
  top: 42px;
  left: -43px;

  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}


.ribbon-wrapper.left-bottom .ribbon {
  top: 80px;
  left: -43px;

  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

.ribbon-wrapper.right-bottom .ribbon {
  top: 80px;
  right: -43px;

  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}