Card

<a href="#" class="card">
    <div class="card__header">
        <img class="card__header__image" src="../../assets/bg-images/general/visual-workshop-12.webp" />
        <ul class="card__header__tags">
            <li class="card__header__tag">Label</li>
            <li class="card__header__tag">Label</li>
        </ul>
    </div>
    <div class="card__content">
        <div class="card__content__body">
            <div class="card__content__body__subheadline">Ich bin eine Headline</div>
            <h2 class="card__content__body__headline">Ich bin eine Headline</h2>
            <p class="card__content__body__text">
                Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
            </p>
        </div>
        <div class="card__content__footer">
            <div>
                <h3 class="card__content__footer__heading">Ich bin eine Headline</h3>
                <ul class="checklist">
                    <li>Ich bin ein kleines Listitem</li>
                    <li>Ich bin ein kleines Listitem</li>
                </ul>
            </div>
            <div>
                <h3 class="card__content__footer__heading">Ich bin eine Headline</h3>
                <p class="standalone">Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</p>
            </div>
            <span class="card__content__footer__link link-teaser inverted-text-color">Mehr erfahren</span>
        </div>
    </div>
</a>
<a href="#" class="card">
    <div class="card__header">
        <img class="card__header__image" src="{{ path '/assets/bg-images/general/visual-workshop-12.webp'}}" />
        <ul class="card__header__tags">
            <li class="card__header__tag">Label</li>
            <li class="card__header__tag">Label</li>
        </ul>
    </div>
    <div class="card__content">
        <div class="card__content__body">
            <div class="card__content__body__subheadline">{{headline}}</div>
            <h2 class="card__content__body__headline">{{headline}}</h2>
            <p class="card__content__body__text">
                {{text_short}}
            </p>
        </div>
        <div class="card__content__footer">
            <div>
                <h3 class="card__content__footer__heading">{{headline}}</h3>
                <ul class="checklist">
                    <li>{{listitem}}</li>
                    <li>{{listitem}}</li>
                </ul>
            </div>
            <div>
                <h3 class="card__content__footer__heading">{{headline}}</h3>
                <p class="standalone">{{text_short}}</p>
            </div>
            <span class="card__content__footer__link link-teaser inverted-text-color">Mehr erfahren</span>
        </div>
    </div>
</a>
{
  "text_short": "Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
  "headline": "Ich bin eine Headline",
  "listitem": "Ich bin ein kleines Listitem"
}
  • Content:
    .card {
      @extend %link-unstyled;
    
      display: flex;
      flex-direction: column;
    }
    
    .card__header {
      position: relative;
    }
    
    .card__header__image {
      max-width: 100%;
    }
    
    .card__header__tags {
      @extend %list-unstyled;
    
      position: absolute;
      top: 0;
      left: 0;
      margin-top: $spacer-md;
    }
    
    .card__header__tag {
      @extend %heading-font-bold;
    
      padding: $spacer-xxs;
      background-color: $card-tag-bg-color;
      color: $card-tag-text-color;
      font-size: $font-size-xs;
      text-transform: uppercase;
    
      + .card__header__tag {
        margin-top: $spacer-xs;
      }
    }
    
    .card__content {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
    }
    
    .card__content__body {
      padding: $spacer-sm;
      background-color: $card-bg-color;
    }
    
    .card__content__body__subheadline {
      @extend %teaser-caption;
    
      color: $card-subheadline-color;
      line-height: $paragraph-line-height;
    }
    
    .card__content__body__headline {
      @extend %h3;
    
      margin-top: $spacer-xxs;
      color: $card-headline-color;
    }
    
    .card__content__body__text {
      @extend %body-font-italic;
    
      margin-top: $spacer-sm;
      color: $card-text-color;
      font-size: $font-size-sm;
    }
    
    .card__content__footer {
      padding: $spacer-sm;
      background-color: $card-headline-color;
    
      > * + * {
        margin-top: $spacer-md;
      }
    
      .card__content__footer__heading {
        @extend %h5;
    
        color: $card-bg-color;
        text-transform: uppercase;
      }
    
      .standalone {
        color: $card-subheadline-color;
      }
    
      .checklist {
        color: $card-subheadline-color;
    
        li::marker {
          color: $card-bg-color;
        }
      }
    
      .card__content__footer__link {
        display: inline-block;
      }
    }
    
    // Breakpoints
    @media screen and (min-width: $grid-breakpoint-sm) {
      .card__content__footer {
        display: grid;
        gap: $spacer-base;
        grid-template-columns: 1fr 1fr;
    
        > * + * {
          margin-top: 0;
        }
      }
    }
    
    @media screen and (min-width: $grid-breakpoint-md) {
      .card__content {
        margin: 0 $spacer-base (-$spacer-xxl) $spacer-base;
        transform: translateY(-$spacer-xxl);
      }
    
      .card__content__body,
      .card__content__footer {
        height: 22rem; //magic number
      }
    
      .card__content__footer__link {
        align-self: flex-end;
        justify-self: baseline;
      }
    }
    
  • URL: /components/raw/card/_card.scss
  • Filesystem Path: components/04-molecules/visual-elements/card/_card.scss
  • Size: 2.2 KB

No notes defined.