/* ======================== // // _____ _ _ // / ____| (_) | | // | | __ _ __ _ __| | // | | |_ | '__| |/ _` | // | |__| | | | | (_| | // \_____|_| |_|\__,_| // ======================== */ $one-column: 700px; $two-column: 900px; $three-column: 1200px; $four-column: 1500px; /* Standard grid */ .card-grid { display: grid; background-color: var(--border); grid-template-rows: repeat(auto-fill, 1fr); grid-column-gap: 1px; grid-row-gap: 1px; // One column ~ Mobile @media all and (max-width: $one-column) { grid-template-columns: repeat(1, minmax(300px, 1fr)); } // Two columns ~ Tablet, landscape, slim window @media all and (min-width: $one-column + 1px) and (max-width: $two-column) { grid-template-columns: repeat(2, minmax(300px, 1fr)); } // Three columns ~ small windows, larger tablets @media all and (min-width: $two-column + 1px) and (max-width: $three-column) { grid-template-columns: repeat(3, minmax(300px, 1fr)); } // Four columns ~ standard windows, 13in laptops @media all and (min-width: $three-column + 1px) and (max-width: $four-column) { grid-template-columns: repeat(4, minmax(300px, 1fr)); } // Five columns++ ~ larger laptops, desktops, tvs, etc @media all and (min-width: $four-column + 1px) { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } & > article, & > div { background-color: var(--background); width: 100%; overflow: hidden; &.double-wide { grid-column-end: span 4; } } } .grid-card { display: flex; flex-direction: column; justify-content: space-between; } /* Standard grid card */ .card { display: flex; background-color: var(--background); &:not(.horizontal) { // Cards flex vertical by default flex-direction: column; } &.horizontal { flex-direction: row; } &.justified { // Justify content vertically justify-content: space-between; } &:not(.e2e) { padding: (2 * $unit) + px; & > footer { margin-top: (2 * $unit) + px; } } &.e2e { .content { padding: (2 * $unit) + px; padding-bottom: 0; } & > footer { padding: (2 * $unit) + px; padding-top: 0; } } .content { flex-grow: 1; } & > footer { flex-grow: 0; display: flex; justify-content: space-between; align-items: flex-end; } // Grid spacers for filling empty space &.grid-spacer { display: block; } // One column ~ Mobile @media all and (max-width: $one-column) { &.grid-spacer { display: none; } } // Two columns ~ Tablet, landscape, slim window @media all and (min-width: $one-column + 1px) and (max-width: $two-column) { &.grid-spacer { display: block; } } // Three columns ~ small windows, larger tablets @media all and (min-width: $two-column + 1px) and (max-width: $three-column) { &.grid-spacer { display: block; } } // Four columns ~ standard windows, 13in laptops @media all and (min-width: $three-column + 1px) and (max-width: $four-column) { &.grid-spacer { display: block; } } // Five columns++ ~ larger laptops, desktops, tvs, etc @media all and (min-width: $four-column + 1px) { &.grid-spacer { display: block; } } }