Newer
Older
Website / src / app / grid / grid.component.scss
:host {
    padding: 0;
    @media (min-width: 500px) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 10px;
        grid-auto-flow: dense;
    }
    @media (min-width: 750px) {
        grid-template-columns: repeat(3, 1fr);
    }
    @media (min-width: 1000px) {
        grid-template-columns: repeat(4, 1fr);
    }
     ::ng-deep>mat-card {
        background-color: #2C2C2C;
        transition: background-color 1s;
    }
     ::ng-deep>mat-card:hover {
        background-color: #2E2E2E;
    }
    max-width: 150ch;
    margin: auto;
}

// inspired by https://codepen.io/oliviale/pen/BaoXOOP
:host ::ng-deep p,
:host ::ng-deep span {
    text-align: justify;
    line-height: 1.3;
}

:host ::ng-deep h1,
:host ::ng-deep h2,
:host ::ng-deep h3,
:host ::ng-deep h4,
:host ::ng-deep h5 {
    font-weight: bolder;
    text-align: center;
}

:host ::ng-deep h1 {
    font-size: 2em;
}

:host ::ng-deep h3 {
    font-size: 1.5em;
}

:host ::ng-deep h4 {
    font-size: 1.25em;
}

:host ::ng-deep em {
    font-style: italic;
}

:host ::ng-deep .wide-2 {
    grid-column: span 2;
}

:host ::ng-deep .wide-3 {
    grid-column: span 2;
}

:host ::ng-deep .wide-full {
    grid-column: 1 / -1;
}

:host ::ng-deep .wide-4 {
    grid-column: span 4;
}

:host ::ng-deep .tall-2 {
    grid-row: span 2;
}

:host ::ng-deep .tall-3 {
    grid-row: span 3;
}

:host ::ng-deep .tall-4 {
    grid-row: span 4;
}

:host ::ng-deep img {
    width: 100%;
    filter: grayscale(1);
    margin-bottom: 0.5rem;
    border: 1px solid var(--black);
    transition: 0.3s ease;
}

@media (min-width: 700px) {
     :host ::ng-deep .multi-column {
        column-count: 2;
        column-gap: 1.3rem;
        margin-top: 0.75rem;
        &-3 {
            column-count: 3;
        }
    }
}

:host ::ng-deep mat-card:hover>img {
    filter: grayscale(0);
}