Last active
January 24, 2021 15:02
-
-
Save 5t3ph/9b3553c38acbdae8848b2634c17b4423 to your computer and use it in GitHub Desktop.
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
span { | |
border: 2px dashed currentcolor; | |
border-radius: 4px; | |
min-height: 15vh; | |
padding: 1rem; | |
color: #0178d4; | |
font-size: 3rem; | |
text-align: center; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} | |
div:nth-child(2) span { | |
color: purple; | |
} | |
div:nth-child(3) span { | |
color: green; | |
} | |
div:nth-child(4) span { | |
color: orangered; | |
} |
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
<main class="grid-wrap"> | |
<div class="grid"> | |
<span>One column default</span> | |
</div> | |
<div class="grid"> | |
<span>Half column 1</span> | |
<span>Half column 2</span> | |
</div> | |
<div class="grid"> | |
<span>3-col 1</span> | |
<span>3-col 2</span> | |
<span>3-col 3</span> | |
</div> | |
<div class="grid"> | |
<span>4-col 1</span> | |
<span>4-col 2</span> | |
<span>4-col 3</span> | |
<span>4-col 4</span> | |
</div> | |
</main> |
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
$minColWidth: 15rem; | |
$gridGap: 2rem; | |
.grid-wrap { | |
padding: $gridGap; | |
} | |
.grid { | |
display: grid; | |
grid-template-columns: repeat(auto-fit, minmax($minColWidth, 1fr)); | |
grid-gap: 2rem; | |
& + .grid { | |
margin-top: $gridGap; | |
} | |
} | |
@import "grid-item"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment