Custom Scrollbar inside md-container #1997
-
ContextI want to make a custom scrollbar like this: But if I move the cat, it will leave a bad gap here I want to fill that part will color depending on the palette I am selecting (slate/light/custom). But it seems hard, so I decided to put the cat into the default scrollbar inside. Replace the default one with the cat like this The problem is it somehow did not allow the webkit I continue to try using gradient of colors But it will depend on the size if we zoom So I also tried to make a custom overflow with max-height like this but for some reason, I cant override the thumb or the track of it anymore :/ so I ended up having this.... File CSSbody::-webkit-scrollbar {
width: 0;
height: 0;
display: none;
/* width: 30px; */
}
body::-webkit-scrollbar-track {
background: transparent;
}
body::-webkit-scrollbar-thumb {
width: 68px;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/cat.gif"),
linear-gradient(
90deg,
transparent,
magenta,
red,
yellow,
limegreen,
turquoise,
blue,
magenta,
transparent
);
background-position: center bottom, center -40px;
background-repeat: no-repeat, no-repeat;
background-size: contain, contain;
}
.md-main {
overflow-x: hidden;
overflow-y: scroll;
width: 100%;
height: 100%;
max-height: 720px;
}
.md-main::-webkit-scrollbar-track {
background: transparent;
}
.md-main::-webkit-scrollbar-thumb {
width: 68px;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/cat.gif"),
linear-gradient(
90deg,
transparent,
magenta,
red,
yellow,
limegreen,
turquoise,
blue,
magenta,
transparent
);
background-position: center bottom, center -40px;
background-repeat: no-repeat, no-repeat;
background-size: contain, contain;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Unfortunately, I don't have time to provide people with custom solutions for things. I mainly spend my time maintaining the project and answering questions related to using the project. |
Beta Was this translation helpful? Give feedback.
Unfortunately, I don't have time to provide people with custom solutions for things. I mainly spend my time maintaining the project and answering questions related to using the project.