No notes defined.

<div class=" card">
    <div class="card__container">
        <div class="card__icon">
            <svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" viewBox="0 0 6 6" stroke-width=".25" stroke="currentColor" fill="none">
                <rect x="1" y="1" width="4" height="4" rx="1" />
            </svg>
        </div>
        <h4 class="card__heading">One Great Heading</h4>
        <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 href="" class="card__action button -secondary">Learn More</a>
            <a href="" class="card__action button -primary">Register</a>
        </div>
    </div>
</div>
  • 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