Promo Hero

By Kevin

F6
#
How do I use This?

Promo Hero for an eCommerce site that can be used to highlight new products or deals.

HTML
<div class="promo-hero promo-hero-bg-image">
  <div class="promo-hero-content">
    <h1 class="promo-hero-title">Promo Headline Will Display Here</h1>
    <p class="promo-hero-description hide-for-small-only">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc tortor ante, varius eget lacinia porta, faucibus ut eros. Donec quis dui id felis pharetra fermentum.</p>
    <div class="promo-hero-ctas">
      <a href="#" class="promo-section-cta button primary">Shop Now</a>
      <a href="#" class="promo-section-cta button white-hollow">Learn More</a>
    </div>
  </div>
</div>
.promo-hero {
  width: 100%;
  text-align: center;
  height: 420px;
  background: $dark-gray;
  position: relative;
  color: white;

  .button.white-hollow {
    border: 1px solid $white;
    color: $white;
    background-color: transparent;
    transition: border 0.5s ease;

    &:hover,
    &:active,
    &:focus {
      border: 1px solid darken($white, 30%);
      transition: border 0.5s ease;
    }
  }
}

.promo-hero-content {
  z-index: 10;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
}

.promo-hero-title {
  line-height: 1.25em;
  margin-bottom: 1rem;
}

.promo-hero-description {
  margin-bottom: 1rem;
}


.promo-hero-bg-image {
  overflow: hidden;
  background-image: url(https://placehold.it/2000x900);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  // overlay
  &:before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    position: relative;
    z-index: 1;
  }
}


.promo-hero {
  width: 100%;
  text-align: center;
  height: 420px;
  background: #8a8a8a;
  position: relative;
  color: white;
}

.promo-hero .button.white-hollow {
  border: 1px solid #fefefe;
  color: #fefefe;
  background-color: transparent;
  transition: border 0.5s ease;
}

.promo-hero .button.white-hollow:hover, .promo-hero .button.white-hollow:active, .promo-hero .button.white-hollow:focus {
  border: 1px solid #b2b2b2;
  transition: border 0.5s ease;
}

.promo-hero-content {
  z-index: 10;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
}

.promo-hero-title {
  line-height: 1.25em;
  margin-bottom: 1rem;
}

.promo-hero-description {
  margin-bottom: 1rem;
}

.promo-hero-bg-image {
  overflow: hidden;
  background-image: url(https://placehold.it/2000x900);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.promo-hero-bg-image:before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

JS