input-range-scss
Version:
Sass component for customizing the input range using the native properties of each browser.
110 lines • 3.12 kB
CSS
[type=range] {
appearance: none;
-webkit-appearance: none;
background: transparent;
margin: 12px 0;
width: 100%;
}
[type=range]::-moz-focus-outer {
border: 0;
}
[type=range]:focus {
outline: none;
}
[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]::-webkit-slider-runnable-track {
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
border-radius: 5px;
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;
}
[type=range]::-moz-range-track {
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
border-radius: 5px;
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;
height: 4px;
}
[type=range]::-ms-track {
cursor: default;
height: 8px;
transition: all 0.2s ease;
width: 100%;
border-radius: 5px;
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-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]::-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;
margin-top: -10px;
}
[type=range]::-webkit-slider-thumb:focus {
box-shadow: 0 0 5px rgba(0, 0, 255, 0.5);
}
[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:focus {
box-shadow: 0 0 5px rgba(0, 0, 255, 0.5);
}
[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:focus {
box-shadow: 0 0 5px rgba(0, 0, 255, 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;
}