SumOfUs/Champaign

View on GitHub
app/assets/stylesheets/member-facing/recommend_pages.scss

Summary

Maintainability
Test Coverage
$small-screen-gutter: 5%;
$medium-screen-gutter: 2%;
$large-screen-gutter: 1.5%;

@mixin centered-to-full($width, $padding: 0%) {
  width: $width;
  margin: 0 auto;
  @include full-width-after($width, $padding);
}

.full-screen-block {
  height: 100vh;
  width: 100vw;
  position: relative;
  margin-left: -50vw;
  left: 50%;
  min-height: 700px;
  max-height: 780px; }

.similar-block {
  text-align: center;
  &__subheader {
    @include centered-to-full(620px);
    margin: 0 auto;
    margin-bottom: 30px;
    margin-top: 20px;
    font-size: 24px;
    line-height: 30px;
    color: $navy;
    h1 {
      font-weight: normal;
      font-weight: lighter;
    }
  }
  &__campaigns {
    @include centered-to-full(960px);
    overflow: hidden;
    margin-bottom: 80px;
    .campaign-tile:last-of-type {
      // this is to show 3 across at wide screen and 2x2 in between
      @media(min-width: 960px) {
        display: none;
      }
      @media(max-width: 600px) {
        display: none;
      }
    }
  }
}


.campaign-tile {
  $single-height: 420px;
  $vertical-spacing: 30px;
  background: $chalk-gray;
  margin-top: $vertical-spacing / 2;
  margin-bottom: $vertical-spacing / 2;
  float: left;
  font-size: 22px;
  line-height: 30px;
  font-weight: lighter;
  color: $navy;
  text-align: left;
  position: relative;
  height: $single-height;
  width: 100% - (2 * $small-screen-gutter);
  margin-left: $small-screen-gutter;
  margin-right: $small-screen-gutter;
  display: block;
  opacity: 1;

  &:hover {
    text-decoration: none;
    .campaign-tile__open-cta {
      text-decoration: underline;
    }
  }
  @media(min-width: 600px) {
    width: 100% / 2 - (2 * $medium-screen-gutter);
    margin-left: $medium-screen-gutter;
    margin-right: $medium-screen-gutter;
  }
  @media(min-width: 960px) {
    width: 100% / 3 - (2 * $large-screen-gutter);
    margin-left: $large-screen-gutter;
    margin-right: $large-screen-gutter;
  }
  &__image {
    background-size: cover;
    background-position: center;
    transition: height 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
  }
  &__lead, &__details {
    padding: 30px 30px 0;
    overflow: hidden;
  }
  &__lead {
    max-height: 120px;
  }
  &__cta {
    font-weight: bold;
    font-size: 16px;
    line-height: 1em;
    position: absolute;
    left: 30px;
    bottom: 30px;
    cursor: pointer;
  }
  &--compact {
    cursor: pointer;
    @include box-sizing(border-box);
    .campaign-tile__image {
      width: 100%;
      height: 205px;
    }
  }
  &__overlay {
    position: absolute;
    bottom: 0;
    height: 38px;
    font-weight: bold;
    color: white;
    font-size: 14px;
    padding: 4px 30px;
    width: 100%;
    @include box-sizing(border-box);
    background: rgba($dark-navy, 0.6);
    @include transition(bottom 0.2s ease-in-out);
  }
}