<div class="wrapper">
<input type="range" min="0" max="100" value="50" />
</div>
<div class="wrapper">
<input type="range" min="0" max="100" value="50" step="12.5" />
</div>
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
max-width: 480px;
margin: 0 auto;
background-color: #05051a;
display: grid;
grid-template-columns: 1fr 1fr;
place-items: center;
}
.wrapper {
position: relative;
height: 20rem;
width: 3rem;
&::before,
&::after {
display: block;
position: absolute;
z-index: 99;
color: #fff;
width: 100%;
text-align: center;
font-size: 1.5rem;
line-height: 1;
padding: .75rem 0;
pointer-events: none;
}
&::before {
content: "+";
}
&::after {
content: "−";
bottom: 0;
}
}
input[type="range"] {
appearance: none;
background-color: rgba(#fff, .2);
position: absolute;
top: 50%;
left: 50%;
margin: 0;
padding: 0;
width: 20rem;
height: 3.5rem;
transform: translate(-50%, -50%) rotate(-90deg);
border-radius: 1rem;
overflow: hidden;
cursor: row-resize;
&[step]{
background-color: transparent;
background-image: repeating-linear-gradient(to right, rgba(#fff, .2), rgba(#fff, .2) calc(12.5% - 1px), #05051a 12.5%);
}
&::slider-thumb {
appearance: none;
width: 0;
box-shadow: -20rem 0 0 20rem rgba(#fff, 0.2);
}
&::range-thumb {
border: none;
width: 0;
box-shadow: -20rem 0 0 20rem rgba(#fff, 0.2);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.