Instantly share code, notes, and snippets.

Embed
What would you like to do?
Live Coding demo during the MSCC Code Saturday
<template>
<div id="app">
<h1>Website of boxes</h1>
<div class="text-box">
Is this kinda boring?
</div>
<div class="text-box red">
Is this kinda boring?
</div>
<div class="text-box lexp">
Is this kinda boring?
</div>
<div class="box-container">
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
<div class="box">
<img src="https://picsum.photos/200/300" alt="">
</div>
</div>
</div>
</template>
<style lang="scss">
* {
margin: 0;
padding: 0;
}
.box-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
:root {
--primary: black;
--secondary: white;
}
.box {
img {
width: 100%;
display: block;
object-fit: cover;
}
}
.text-box {
font-size: 40px;
font-weight: bold;
color: var(--primary);
background: var(--secondary);
border: 10px dotted var(--primary);
margin-bottom: 20px;
transition: border-width 0.2s linear;
&:hover {
border-width: var(--size, 10px);
transition: border-width 0.2s linear;
}
}
.red {
--primary: red;
--secondary: black;
}
.lexp {
--primary: #004a8f;
--secondary: gray;
--size: 20px;
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment