No notes defined.

<bp-clickable v-slot="{ click }">
    <div class=" card -clickable -wide" @click="click($event, $refs.link)">
        <div class="card__container">
            <div class="card__background">
                <picture class="">
                    <source type="image/webp" data-srcset="https://picsum.photos/640/640.webp 640w, https://picsum.photos/1024/1024.webp 1024w, https://picsum.photos/1440/1440.webp 1440w, https://picsum.photos/1920/1920.webp 1920w" data-sizes="auto" />

                    <img src="data:image/svg+xml;utf8,<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;1920&quot; width=&quot;1920&quot;></svg>" alt="Placeholder Image" class="lazyload  card__backgroundImg" data-srcset="https://picsum.photos/640/640 640w, https://picsum.photos/1024/1024 1024w, https://picsum.photos/1440/1440 1440w, https://picsum.photos/1920/1920 1920w" data-sizes="auto" />
                </picture>
            </div>
            <h3 class="card__heading">One Great Heading</h3>
            <p class="card__content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos et voluptatum aliquam neque beatae.</p>
            <div class="card__actions -attached">
                <a ref="link" href="#foo" class="card__action button -primary">Learn More</a>
            </div>
        </div>
    </div>
</bp-clickable>
  • Content:
    ///
    /// Simple card.
    ///
    @mixin card() {
        $b: &;
    
        background-color: $white;
        box-shadow: $med-shadow;
        margin-bottom: $v-space;
        z-index: 1;
    
        &__container {
            display: grid;
            grid-gap: 1rem;
            grid-template: "icon" "heading" "content" 1fr "actions" / auto;
            height: 100%;
        }
    
        &__icon,
        &__heading,
        &__content,
        &__actions {
            justify-self: center; // For IE11 (instead of justify-items)
            padding-left: $h-space;
            padding-right: $h-space;
            position: relative;
        }
    
        &__tag {
            align-self: start;
            color: $meta-text;
            font-size: .875rem;
            font-weight: bold;
            grid-area: icon;
            justify-self: start;
            padding: $thin-padding;
            text-transform: uppercase;
    
            &.-overlay {
                color: $black;
            }
        }
    
        &__icon {
            grid-area: icon;
            padding-top: $v-space;
            text-align: center; // For IE11
        }
    
        &__heading {
            grid-area: heading;
        }
    
        &__content {
            grid-area: content;
            width: 100%;
        }
    
    
        &__background {
            background: $gray-100 center/cover;
            grid-column: 1;
            grid-row: icon / heading;
            height: 100%;
            justify-self: stretch;
        }
    
        &__actions {
            grid-area: actions;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            justify-self: stretch;
            margin-top: auto;
            padding-bottom: $v-space;
    
            &.-attached {
                justify-content: stretch;
                padding-bottom: 0;
                padding-left: 0;
                padding-right: 0;
    
                .card__action {
                    flex-grow: 1;
                }
            }
        }
    
        &__action {
            flex-basis: max(9rem, 50%);
        }
    
        &.-clickable {
            cursor: pointer;
        }
    
        &.-wide {
            #{$b}__container {
                grid-gap: 1rem 0;
                grid-template: "background heading" "background content" 1fr "background actions" / 1fr 1fr;
            }
    
            #{$b}__background {
                grid-area: background;
            }
    
            #{$b}__backgroundImg {
                height: 100%;
                object-fit: cover;
            }
    
            #{$b}__heading {
                padding-top: $v-space;
            }
        }
    }
    
    .card {
        @include card;
    }
    
  • URL: /components/raw/card/card.scss
  • Filesystem Path: resources/styles/molecules/card/card.scss
  • Size: 2.3 KB