I am playing around with css grid layouts and was following this tutorial and was wondering how could I add a scroll bar that after a certain height the content would vertically scroll.
All my attempts so far do make the scrollbar but the bottom arrow gets cut off.
https://codepen.io/anon/pen/rwLRpJ
<div class="grid-container">
<div class="grid-element header">Header</div>
<div class="grid-element sidebar">
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
<div> test </div>
</div>
<div class="grid-element main">
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
<div class="input-field">
<input placeholder="Placeholder" type="text" class="validate">
</div>
</div>
</div>
body {
text-align: center;
font-family: "Dosis";
}
.grid-container {
display: grid;
grid-template-columns: 0.25fr 10px 0.75fr;
grid-template-rows: auto 20px auto 20px auto 20px auto;
height: 100vh;
}
.grid-element {
background-color: #444;
color: #fff;
padding: 20px;
font-size: 2em;
}
.header {
grid-column-start: 1;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 2;
background: #69F;
}
.sidebar {
grid-column-start: 1;
grid-column-end: 2;
grid-row-start: 3;
grid-row-end: 6;
background: #6F9;
overflow-y: auto;
}
.main {
grid-column-start: 3;
grid-column-end: 4;
grid-row-start: 3;
grid-row-end: 4;
background: #F69;
}