<div class="shop-diptych u-block u-page-width-max-gutters">
    <div class="shop-diptych__item shop-diptych__item--sunglasses">
        <a class="shop-diptych__link" href="#">
            <h2 class="shop-diptych__title">Sunglasses</h2>
            <img class="shop-diptych__image" src="/assets/images/diptych-sunglasses-large.png" sizes="50vw" srcset="/assets/images/diptych-sunglasses-small.png 320w, /assets/images/diptych-sunglasses-large.png 580w">
            <button class="shop-diptych__call-to-action button button--primary">Shop</button>
        </a>
    </div>
    <div class="shop-diptych__item shop-diptych__item--eyeglasses">
        <a class="shop-diptych__link" href="#">
            <h2 class="shop-diptych__title">Eyeglasses</h2>
            <img class="shop-diptych__image" src="/assets/images/diptych-eyeglasses-large.png" sizes="50vw" srcset="/assets/images/diptych-eyeglasses-small.png 320w, /assets/images/diptych-eyeglasses-large.png 580w">
            <button class="shop-diptych__call-to-action button button--primary">Shop</button>
        </a>
    </div>
</div>
<div class="shop-diptych u-block u-page-width-max-gutters">
  {{#each items}}
  <div class="shop-diptych__item shop-diptych__item--{{modifier}}">
    <a class="shop-diptych__link" href="#">
      <h2 class="shop-diptych__title">{{title}}</h2>
      <img class="shop-diptych__image" src="/assets/images/diptych-{{modifier}}-large.png" sizes="50vw"
          srcset="/assets/images/diptych-{{modifier}}-small.png 320w, /assets/images/diptych-{{modifier}}-large.png 580w">
      <button class="shop-diptych__call-to-action button button--primary">{{callToAction}}</button>
    </a>
  </div>
  {{/each}}
</div>
{
  "items": [
    {
      "modifier": "sunglasses",
      "path": "#",
      "title": "Sunglasses",
      "callToAction": "Shop"
    },
    {
      "modifier": "eyeglasses",
      "path": "#",
      "title": "Eyeglasses",
      "image": null,
      "callToAction": "Shop"
    }
  ]
}
  • Content:
    .shop-diptych {
      margin-top: 20px;
      text-align: center;
    
      @include breakpoint($breakpoint-md) {
        font-size: 0;
      }
    }
    
    .shop-diptych__item {
      position: relative;
      height: 175px;
      margin-bottom: 25px;
    
      &:after {
        display: block;
        position: absolute;
        top: 35px;
        right: 0;
        left: 50%;
        width: 140px;
        height: 140px;
        margin-left: -70px;
        background: #{map-get($image-diptych-background, sm)};
        content: '';
        z-index: -1;
      }
    
      @include breakpoint($breakpoint-md) {
        display: inline-block;
        width: 320px;
        max-width: calc(50% - 40px);
        height: auto;
        margin: 0 $gutter-width-half;
    
        &:hover:before {
          position: absolute;
          top: -20px;
          right: 0;
          bottom: -30px;
          left: 0;
          border: 1px solid $color-primary;
          content: '';
          pointer-events: none;
        }
    
        &:after {
          top: 65px;
          width: 150px;
          height: 150px;
          margin-left: -75px;
          background-image: #{map-get($image-diptych-background, md)};
        }
      }
    
      @include breakpoint($breakpoint-lg) {
        width: 380px;
    
        &:after {
          width: 180px;
          height: 180px;
          margin-left: -90px;
          background-image: #{map-get($image-diptych-background, lg)};
        }
      }
    
      @include breakpoint($breakpoint-xl) {
        width: 500px;
    
        &:after {
          width: 230px;
          height: 230px;
          margin-left: -115px;
          background-image: #{map-get($image-diptych-background, xl)};
        }
      }
    
      @include breakpoint($page-width-max) {
        width: 580px;
    
        &:after {
          width: 260px;
          height: 260px;
          margin-left: -130px;
          background-image: #{map-get($image-diptych-background, max)};
        }
      }
    }
    
    .shop-diptych__link {
      color: $color-darkest;
      text-decoration: none;
    }
    
    .shop-diptych__title {
      margin: 10px 0 20px;
      font-size: 2rem;
      letter-spacing: 1px;
      text-transform: uppercase;
    
      @include breakpoint($breakpoint-md) {
        margin-bottom: 35px;
        font-size: 2.7rem;
        letter-spacing: 2px;
        line-height: 3.0rem;
      }
    }
    
    .shop-diptych__image {
      width: 320px;
      margin: 0 auto;
    
      @include breakpoint($breakpoint-md) {
        margin-bottom: 35px;
      }
    
      @include breakpoint($breakpoint-lg) {
        width: 100%;
        margin-bottom: 0;
      }
    }
    
    .shop-diptych__call-to-action {
      display: none;
    
      @include breakpoint($breakpoint-md) {
        display: inline-block;
        width: auto;
      }
    }
    
  • URL: /components/raw/shop-diptych/shop-diptych.scss
  • Filesystem Path: src/components/02-components/shop-diptych/shop-diptych.scss
  • Size: 2.4 KB
  • Handle: @shop-diptych
  • Preview:
  • Filesystem Path: src/components/02-components/shop-diptych/shop-diptych.html

There are no notes for this item.