unlcms / project-herbie

Drupal 10 implementation at the University of Nebraska–Lincoln
https://cms.unl.edu
GNU General Public License v2.0
5 stars 6 forks source link

Updates to existing tandem component #662

Open skoolbus39 opened 2 months ago

skoolbus39 commented 2 months ago

Update .unlcms-grid-cols globally (all UNL CMS):

<style>

    /* UPDATED UNL CMS GRID FOR GLOBAL */

    @media only screen and (max-width: 42.09em) {

      .unlcms-grid-cols {
        grid-template-columns: 5.62vw 3.16rem 1rem 1fr 1fr 1.58vw 1.58vw 1fr 1fr 1rem 3.16rem 5.62vw;
      }

    }

    @media only screen and (min-width: 42.09em) and (max-width: 56.12em) {

      .unlcms-grid-cols {
        grid-template-columns: 5.62vw 3.16rem 1rem 1fr 1fr 1fr 1.58vw 1.58vw 1fr 1fr 1fr 1rem 3.16rem 5.62vw;
      }

    }

    @media only screen and (min-width: 56.12em) {

      .unlcms-grid-cols {
        grid-template-columns: 5.62vw 3.16rem 1rem 1fr 1fr 1fr 1fr 1rem 3.16rem 1.58vw 1.58vw 3.16rem 1rem 1fr 1fr 1fr 1fr 1rem 3.16rem 5.62vw;
      }

    }

</style>

Update CSS for all tandems:

<style>

  /* TANDEM */
  .unlcms-tandem-text p:last-child,
  .unlcms-tandem-text ol:last-child,
  .unlcms-tandem-text ul:last-child {
    margin-bottom: 0;
  }

</style>

Update CSS for Tandem – Stack:

<style>

  /* TANDEM - STACK */

  /* max sm 673 */
  @media only screen and (max-width: 42.09em) {

    .unlcms-tandem-stack-text {
      grid-area: 3 / 2 / 4 / -2;
    }

    .unlcms-tandem-stack-img {
      grid-area: 1 / 1 / 2 / -1;
    }

  }

  /* sm 673 */
  @media only screen and (min-width: 42.09em) and (max-width: 56.12em) {

    .unlcms-tandem-stack-text {
      grid-area: 3 / 4 / 4 / -4;
    }

    .unlcms-tandem-stack-img {
      grid-area: 1 / 4 / 2 / -4;
    }

  }

  /* max md 898 */
  @media only screen and (max-width: 56.12em) {

    .unlcms-tandem-stack {
      grid-template-rows: auto 1.33em auto 3.16em;
    }

  }

  /* sm 673 */
  @media only screen and (min-width: 56.12em) {

    .unlcms-tandem-stack {
      grid-template-rows: minmax(4.21em, 1fr) auto minmax(4.21em, 1fr);
    }

    .unlcms-tandem-stack-text-c {
      align-items: center;
      display: flex;
      flex-direction: column;
      grid-area: 2 / 2 / 3 / -2;
      text-align: center;
    }

    .unlcms-tandem-stack-text-c .unlcms-tandem-stack-text-card {
      max-width: 42.09em;
    }

    .unlcms-tandem-stack-text-card {
      background-color: var(--bg-card);
      -webkit-clip-path: polygon(0 0,0 100%,2px 100%,2px 2px,calc(100% - 2px) 2px,calc(100% - 2px) calc(100% - 2px),2px calc(100% - 2px),2px calc(100% - 5px),calc(100% - 5px) calc(100% - 5px),calc(100% - 5px) 5px,5px 5px,5px calc(100% - 5px),2px calc(100% - 5px),2px 100%,100% 100%,100% 0);
      clip-path: polygon(0 0,0 100%,2px 100%,2px 2px,calc(100% - 2px) 2px,calc(100% - 2px) calc(100% - 2px),2px calc(100% - 2px),2px calc(100% - 5px),calc(100% - 5px) calc(100% - 5px),calc(100% - 5px) 5px,5px 5px,5px calc(100% - 5px),2px calc(100% - 5px),2px 100%,100% 100%,100% 0);
      padding: 3.16em 2.37em;
    }

    .unlcms-tandem-stack-img {
      grid-area: 1 / 1 / -1 / -1;
    }

  }

  @media only screen and (min-width: 56.12em) {

    .unlcms-tandem-stack-text-l {
      grid-area: 2 / 2 / -2 / 10;
    }

    .unlcms-tandem-stack-text-r {
      grid-area: 2 / 6 / 3 / -2;
    }

  }

  /* md 898 */
  @media only screen and (min-width: 56.12em) and (max-width: 74.83em) {

    .unlcms-tandem-stack-text-l {
      grid-column-end: 13;
    }

    .unlcms-tandem-stack-text-r {
      grid-column-start: 9;
    }

  }

  /* lg 1197 */
  @media only screen and (min-width: 74.83em) {

    .unlcms-tandem-stack-text-l {
      grid-column-end: 10;
    }

    .unlcms-tandem-stack-text-r {
      grid-column-start: 12;
    }

  }

  /* xl 1596 */
  @media only screen and (min-width: 99.78em) {

    .unlcms-tandem-stack {
      max-height: 42.09em;
      overflow-y: hidden;
    }
  }

</style>

Update CSS for Tandem – Fade:

<style>

  /* TANDEM - FADE */

  .unlcms-tandem-fade {
    background-color: var(--bg-color);
  }

  /* max sm 673 */
  @media only screen and (max-width: 42.09em) {

    .unlcms-tandem-fade-text {
      grid-area: 3 / 2 / 4 / -2;
    }

    .unlcms-tandem-fade-img {
      grid-area: 1 / 1 / 2 / -1;
    }

  }

  /* sm 673 */
  @media only screen and (min-width: 42.09em) and (max-width: 56.12em) {

    .unlcms-tandem-fade-text {
      grid-area: 3 / 4 / 4 / -4;
    }

    .unlcms-tandem-fade-img {
      grid-area: 1 / 4 / 2 / -4;
    }

  }

  /* max md 898 */
  @media only screen and (max-width: 56.12em) {

    .unlcms-tandem-fade {
      grid-template-rows: auto 1.33em auto  3.16em;
    }

  }

  /* md 898 */
  @media only screen and (min-width: 56.12em) {

    .unlcms-tandem-fade {
      grid-template-rows: minmax(4.21em, 1fr) auto minmax(4.21em, 1fr);
    }

    .unlcms-tandem-fade-img::after {
      background-image: linear-gradient(var(--direction), var(--bg-color), transparent);
      content: '';
      height: 100%;
      position: absolute;
      top: 0;
      width: 33%;
      z-index: 1;
    }

    .unlcms-tandem-fade-text-l {
      grid-area: 2 / 2 / 3 / 8;
    }

    .unlcms-tandem-fade-text-l ~ .unlcms-tandem-fade-img::after {
      --direction: 90deg;
    }

    .unlcms-tandem-fade-text-r {
      grid-area: 2 / 12 / 3 / -2;
    }

    .unlcms-tandem-fade-text-r ~ .unlcms-tandem-fade-img::after {
      --direction: 270deg;
      right: 0;
    }

    .unlcms-tandem-fade-text-l ~ .unlcms-tandem-fade-img {
      grid-area: 1 / 10 / -1 / -1;
    }

    .unlcms-tandem-fade-text-r ~ .unlcms-tandem-fade-img {
      grid-area: 1 / 1 / -1 / 8;
    }

  }

  /* lg 1197 */
  @media only screen and (min-width: 74.83em) {

    .unlcms-tandem-fade-text-l ~ .unlcms-tandem-fade-img {
      grid-column-start: 11;
    }

    .unlcms-tandem-fade-text-r ~ .unlcms-tandem-fade-img {
      grid-column-end: 8;
    }

  }

</style>

Update tandem markup (see markup below)

Update Tandem – Stack markup:

<div class="dcf-bleed dcf-d-grid unlcms-grid-cols unlcms-tandem unlcms-tandem-stack">
  <div class="dcf-z-1 unlcms-tandem-text unlcms-tandem-stack-text unlcms-tandem-stack-text-l">
    <div class="unlcms-tandem-stack-text-card">
      <!-- If subhead is present, wrap in header -->
      <header>
        <p class="dcf-mb-3 dcf-txt-xs dcf-lh-3 dcf-uppercase dcf-bold unl-ls-2 unl-dark-gray">Cras mattis consectetur purus sit amet fermentum</p>
        <h2 class="dcf-mt-0">Troy Finds Ways to Serve Others on Campus and in Career</h2>
        <!-- <p class="dcf-mb-5 dcf-txt-xs dcf-lh-3 dcf-uppercase dcf-bold unl-ls-2 unl-dark-gray">Cras mattis consectetur purus sit amet fermentum</p> -->
      </header>
      <p>Max 480 characters. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>
      <!-- if more than one button -->
      <div class="dcf-d-flex dcf-flex-wrap dcf-gap-3 dcf-mt-5" role="group">
        <a class="dcf-btn dcf-btn-primary" href="https://admissions.unl.edu/why-nebraska/majors/">Find Your Major</a>
        <a class="dcf-btn dcf-btn-secondary" href="https://graduate.unl.edu/academics/programs">Find Your Graduate Program</a>
        <a class="dcf-btn dcf-btn-tertiary" href="https://law.unl.edu/degree-programs/">Find Your Law Degree Program</a>
      </div>
      <!-- else only one button (to test: comment out button group above, uncomment line below) -->
      <!-- <a class="dcf-btn dcf-btn-primary dcf-mt-5" href="https://admissions.unl.edu/why-nebraska/majors/">Find Your Major</a> -->
    </div>
  </div>
  <div class="unlcms-tandem-stack-img dcf-ratio dcf-ratio-16x9">
    <picture>
      <source srcset="https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/troy-hero%281%29.jpg?itok=RXYUWolL&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/troy-hero%281%29.jpg?itok=LYtekXDq&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/troy-hero%281%29.jpg?itok=RXYUWolL&amp;timestamp=1673973237 2x" media="(min-width: 1600px)">
      <source srcset="https://www.unl.edu/styles/16x9_2400x1350/public/images/hero/troy-hero%281%29.jpg?itok=X-YcEfBM&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_1600x900/public/images/hero/troy-hero%281%29.jpg?itok=MNkLh4lu&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/troy-hero%281%29.jpg?itok=RXYUWolL&amp;timestamp=1673973237 2x" media="(min-width: 1044px)">
      <source srcset="https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/troy-hero%281%29.jpg?itok=LYtekXDq&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_1280x720/public/images/hero/troy-hero%281%29.jpg?itok=ST8459GL&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_2560x1440/public/images/hero/troy-hero%281%29.jpg?itok=LC0tOyMJ&amp;timestamp=1673973237 2x" media="(min-width: 980px)">
      <source srcset="https://www.unl.edu/styles/16x9_1440x810/public/images/hero/troy-hero%281%29.jpg?itok=mjUV88IF&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_960x540/public/images/hero/troy-hero%281%29.jpg?itok=Kf0oyF1R&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/troy-hero%281%29.jpg?itok=LYtekXDq&amp;timestamp=1673973237 2x" media="(min-width: 768px)">
      <source srcset="https://www.unl.edu/styles/16x9_960x540/public/images/hero/troy-hero%281%29.jpg?itok=Kf0oyF1R&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_640x360/public/images/hero/troy-hero%281%29.jpg?itok=BEWTDPIz&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_1280x720/public/images/hero/troy-hero%281%29.jpg?itok=ST8459GL&amp;timestamp=1673973237 2x" media="(min-width: 480px)">
      <source srcset="https://www.unl.edu/styles/16x9_720x405/public/images/hero/troy-hero%281%29.jpg?itok=P-iUIfst&amp;timestamp=1673973237 1.5x, https://www.unl.edu/styles/16x9_480x270/public/images/hero/troy-hero%281%29.jpg?itok=qKo_hzRB&amp;timestamp=1673973237 1x, https://www.unl.edu/styles/16x9_960x540/public/images/hero/troy-hero%281%29.jpg?itok=Kf0oyF1R&amp;timestamp=1673973237 2x" media="(min-width: 0px)">
      <img class="dcf-ratio-child dcf-obj-fit-cover" fetchpriority="low" src="https://www.unl.edu/styles/16x9_960x540/public/images/hero/troy-hero%281%29.jpg?itok=Kf0oyF1R&amp;timestamp=1673973237" alt="">
    </picture>
  </div>
</div>

Update Tandem – Fade markup:

<div class="dcf-bleed dcf-d-grid unlcms-grid-cols unlcms-tandem unlcms-tandem-fade" style="--bg-color: var(--bg-lighter-gray);">
  <div class="unlcms-tandem-text unlcms-tandem-fade-text unlcms-tandem-fade-text-r">
    <!-- If subhead is present, wrap in header -->
    <header>
      <p class="dcf-mb-3 dcf-txt-xs dcf-lh-3 dcf-uppercase dcf-bold unl-ls-2 unl-dark-gray">Cras mattis consectetur purus sit amet fermentum</p>
      <h2 class="dcf-mt-0">Troy Finds Ways to Serve Others on Campus and in Career</h2>
      <!-- <p class="dcf-mb-5 dcf-txt-xs dcf-lh-3 dcf-uppercase dcf-bold unl-ls-2 unl-dark-gray">Cras mattis consectetur purus sit amet fermentum</p> -->
    </header>
    <p>Max 480 characters. Donec sed odio dui. Nullam quis risus eget urna mollis ornare vel eu leo. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>
    <ul class="dcf-mb-0 dcf-columns-2 dcf-columns-1@md dcf-columns-2@lg">
      <li><a href="https://admissions.unl.edu/why-nebraska/majors/">Find Your Major</a></li>
      <li><a href="https://graduate.unl.edu/academics/programs">Find Your Graduate Program</a></li>
      <li><a href="https://law.unl.edu/degree-programs/">Find Your Law Degree Program</a></li>
      <li><a href="https://admissions.unl.edu/why-nebraska/majors/">Undergraduate</a></li>
      <li><a href="https://graduate.unl.edu/academics/programs">Entrepreneurship</a></li>
      <li><a href="https://law.unl.edu/degree-programs/">Find Your Law Degree Program</a></li>
    </ul>
  </div>
  <div class="unlcms-tandem-fade-img dcf-ratio dcf-ratio-16x9 dcf-ratio-4x3@lg dcf-ratio-16x9@xl">
    <picture>
      <source srcset="https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=I-BsbOiQ&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=x237VIDl&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=I-BsbOiQ&amp;timestamp=1686761056 2x" media="(min-width: 1600px)">
      <source srcset="https://www.unl.edu/styles/16x9_2400x1350/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=Lp-Sbl7V&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_1600x900/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=VQf0-4_N&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_3200x1800/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=I-BsbOiQ&amp;timestamp=1686761056 2x" media="(min-width: 1044px)">
      <source srcset="https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=x237VIDl&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_1280x720/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=3LIZ1tuZ&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_2560x1440/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=m8Vzvtce&amp;timestamp=1686761056 2x" media="(min-width: 980px)">
      <source srcset="https://www.unl.edu/styles/16x9_1440x810/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=9luRmk8f&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_960x540/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=ZZgXGqMV&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_1920x1080/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=x237VIDl&amp;timestamp=1686761056 2x" media="(min-width: 768px)">
      <source srcset="https://www.unl.edu/styles/16x9_960x540/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=ZZgXGqMV&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_640x360/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=_a0zgevJ&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_1280x720/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=3LIZ1tuZ&amp;timestamp=1686761056 2x" media="(min-width: 480px)">
      <source srcset="https://www.unl.edu/styles/16x9_720x405/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=c8k7CWVO&amp;timestamp=1686761056 1.5x, https://www.unl.edu/styles/16x9_480x270/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=zlMuL3Zb&amp;timestamp=1686761056 1x, https://www.unl.edu/styles/16x9_960x540/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=ZZgXGqMV&amp;timestamp=1686761056 2x" media="(min-width: 0px)">
      <img class="dcf-ratio-child dcf-obj-fit-cover" fetchpriority="low" src="https://www.unl.edu/styles/16x9_960x540/public/images/hero/230607_Phillips_070p%281%29.jpg?itok=ZZgXGqMV&amp;timestamp=1686761056" alt="Student standing in front of glass sculpture">
    </picture>
  </div>
</div>