input-range-scss
Version:
Sass component for customizing the input range using the native properties of each browser.
128 lines • 3.8 kB
CSS
[type=range] {
-webkit-appearance: none;
background: transparent;
margin: 12px 0;
width: 100%;
}
[type=range]::-moz-focus-outer {
border: 0;
}
[type=range]:focus {
outline: 0;
}
[type=range]:focus::-webkit-slider-runnable-track {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]:focus::-ms-fill-lower {
background: #eceff1;
}
[type=range]:focus::-ms-fill-upper {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]:focus-visible {
outline: 2px solid rgb(152.6723404255, 174.0212765957, 184.3276595745);
outline-offset: 2px;
}
[type=range]::-webkit-slider-runnable-track {
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(12.75, 12.75, 12.75, 0.2);
background: #eceff1;
border: 2px solid #cfd8dc;
border-radius: 5px;
}
[type=range]::-webkit-slider-runnable-track:active {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]::-webkit-slider-thumb {
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2), 0 0 4px rgba(12.75, 12.75, 12.75, 0.2);
background: #607d8b;
border: 2px solid #eceff1;
border-radius: 12px;
box-sizing: border-box;
cursor: default;
height: 24px;
width: 24px;
-webkit-appearance: none;
margin-top: calc((8px - 24px) / 2);
}
[type=range]::-webkit-slider-thumb:hover {
background: rgb(122.5063829787, 150.1489361702, 163.4936170213);
}
[type=range]::-moz-range-track {
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(12.75, 12.75, 12.75, 0.2);
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
background: #eceff1;
border: 2px solid #cfd8dc;
border-radius: 5px;
height: 4px;
}
[type=range]::-moz-range-track:active {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]::-moz-range-thumb {
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2), 0 0 4px rgba(12.75, 12.75, 12.75, 0.2);
background: #607d8b;
border: 2px solid #eceff1;
border-radius: 12px;
box-sizing: border-box;
cursor: default;
height: 24px;
width: 24px;
}
[type=range]::-moz-range-thumb:hover {
background: rgb(122.5063829787, 150.1489361702, 163.4936170213);
}
[type=range]::-ms-track {
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
background: transparent;
border-color: transparent;
border-width: 12px 0;
color: transparent;
}
[type=range]::-ms-fill-lower {
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(12.75, 12.75, 12.75, 0.2);
background: rgb(221.3181818182, 226.6363636364, 230.1818181818);
border: 2px solid #cfd8dc;
border-radius: 10px;
}
[type=range]::-ms-fill-lower:active {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]::-ms-fill-upper {
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2), 0 0 1px rgba(12.75, 12.75, 12.75, 0.2);
background: #eceff1;
border: 2px solid #cfd8dc;
border-radius: 10px;
}
[type=range]::-ms-fill-upper:active {
background: rgb(250.6818181818, 251.3636363636, 251.8181818182);
}
[type=range]::-ms-thumb {
box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.2), 0 0 4px rgba(12.75, 12.75, 12.75, 0.2);
background: #607d8b;
border: 2px solid #eceff1;
border-radius: 12px;
box-sizing: border-box;
cursor: default;
height: 24px;
width: 24px;
margin-top: 2px;
}
[type=range]::-ms-thumb:hover {
background: rgb(122.5063829787, 150.1489361702, 163.4936170213);
}
[type=range]:disabled {
opacity: 0.5;
}
[type=range]:disabled::-webkit-slider-thumb, [type=range]:disabled::-moz-range-thumb, [type=range]:disabled::-ms-thumb, [type=range]:disabled::-webkit-slider-runnable-track, [type=range]:disabled::-ms-fill-lower, [type=range]:disabled::-ms-fill-upper {
cursor: not-allowed;
}