Hacker News new | past | comments | ask | show | jobs | submit login

Sure it's not the prettiest, but even if you styled this with CSS directly you'd need to target those selectors. `#range-input::webkit-progress-bar` etc.

To your final point, I completely agree that it should be packaged up — I'd package this up into a component (react, partial etc.) which would encapsulate the styles via Tailwind, HTML and logic.

I like Tailwind as a way to more closely tie my markup with styling. I'll package it all up into a component anyway, but Tailwind keeps it all in 1 spot (the markup) rather than spread across multiple files.




You can't put CSS alongside a component's markup in the same file? What kind of framework are you using?

I don't use them all, but I know Vue and Svelte can. React is really popular, so I assume it's got a way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: