Last active
July 1, 2020 08:10
-
-
Save anwas/5e3ee343bf5073f41f95c3829967a473 to your computer and use it in GitHub Desktop.
[CSS grid gallery with fallback] #css #css-grid #scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.grid-gallery { | |
padding: 0.5rem; | |
} | |
.grid-gallery-item { | |
padding: 0; | |
margin: 0.5rem; | |
max-width: 200px; | |
display: inline-block; | |
} | |
@supports (display-area: auto) { | |
.grid-gallery { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(200px, auto)); | |
grid-auto-rows: 200px; | |
grid-gap: 1rem; | |
} | |
.grid-gallery-item { | |
margin: 0; | |
max-width: none; | |
&:first-child { | |
grid-row: span 2; | |
grid-column: span 2; | |
} | |
&:nth-child(5) { | |
grid-row: span 2; | |
} | |
&:nth-child(8) { | |
grid-column: span 2; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment