Skip to content

Commit

Permalink
Css for message overflow with a custom scrollbar (CodingGarden#26)
Browse files Browse the repository at this point in the history
Css Styles for message container
  • Loading branch information
CallumChaney authored Jul 3, 2020
1 parent 5b1d0d1 commit ef9ddc9
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion client/src/views/Messages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="messages">
<Navbar></Navbar>
<main class="messages__main">
<div>
<div class="messages__main--body">
<Message v-for="message in messages" :key="message._id" :message="message" />
</div>
<ChatBox class="messages__main--bottom" />
Expand Down Expand Up @@ -80,6 +80,47 @@ export default {
position: relative;
}
.messages__main--body {
height: 100%;
overflow-y: scroll;
padding-bottom: 70px; /* this is the chatbox height probably wants to be more responsive */
}
.messages__main--body::-webkit-scrollbar {
width: 7px;
}
.messages__main--body::-webkit-scrollbar-track {
border-radius: 10px;
background: $bg-dark;
}
.messages__main--body::-webkit-scrollbar-thumb {
border-radius: 10px;
background: $primary;
}
.messages__main--body::before {
content: '';
position: absolute;
width: 100vw;
height: 1rem;
background: linear-gradient($bg 1%, rgba(1,1,1,0));
top: 0px;
}
.messages__main--body::after {
content: '';
position: absolute;
width: 100vw;
height: 50vh;
background: linear-gradient(rgba(1,1,1,0) 80%, $bg);
bottom: 0px;
}
.messages__main--bottom {
position: absolute;
bottom: 0px;
Expand Down

0 comments on commit ef9ddc9

Please sign in to comment.