i want to change the style of slider like the slider in the link https://aleksfedotov.github.io/pass

i want to change the style of slider like the slider in the link https://aleksfedotov.github.io/pass with tailwindcss
12 Replies
Mannix
Mannix16mo ago
404 There isn't a GitHub Pages site here.
Mannix
Mannix16mo ago
from what i can see this can't be done with purely css/tailwind
indee
indeeOP16mo ago
then how ?
Mannix
Mannix16mo ago
you gonna need js for the green track part for that track they use js to set a gradient also it's broken in firefox
indee
indeeOP16mo ago
is there any way of using css and import it with tailwind
Mannix
Mannix16mo ago
what do you mean?? Just create a css file and link it in the html ???
indee
indeeOP16mo ago
no no i mean @apply or something
Mannix
Mannix16mo ago
extending ?
indee
indeeOP16mo ago
ya
briancross
briancross16mo ago
Here’s a CSS Tricks article about styling range inputs (sliders). It be used it and it works. Not tailwind but just create a CSS file and link it in the head.
indee
indeeOP16mo ago
hey guys ig i found the trick to solve my problem
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
.slider {
-webkit-appearance: none;
appearance: none;
background: transparent;
cursor: pointer;
width: 15rem;
}
.slider::-webkit-slider-runnable-track {
background: #053a5f;
height: 0.5rem;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none; /* Override default look */
appearance: none;
margin-top: -12px; /* Centers thumb on the track */
background-color: #5cd5eb;
height: 2rem;
width: 2rem;
border-radius: 50px;
}
.slider::-webkit-slider-thumb:hover {
background-color: white;
}
}
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
.slider {
-webkit-appearance: none;
appearance: none;
background: transparent;
cursor: pointer;
width: 15rem;
}
.slider::-webkit-slider-runnable-track {
background: #053a5f;
height: 0.5rem;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none; /* Override default look */
appearance: none;
margin-top: -12px; /* Centers thumb on the track */
background-color: #5cd5eb;
height: 2rem;
width: 2rem;
border-radius: 50px;
}
.slider::-webkit-slider-thumb:hover {
background-color: white;
}
}
Want results from more Discord servers?
Add your server