|
|
|
|
|
by xigoi
934 days ago
|
|
> Nobody cares if you used CSS or JS for a toggle switch. Other than the people who have to wait several minutes for your 20MB JavaScript framework to load on their slow metered connection just so you can make an expandable section using a bunch of <div>s rather than the native <details> element. But those people don’t matter because they should just move to a country with unlimited fast internet, am I right? |
|
Nobody is suggesting using a 20mb framework to make a toggle switch work on a standalone page that isn’t a web app.
If you’re building a web app either way, then choosing between a screen full of CSS or a handful of lines of js is negligible.
For expanding sections, you should use native HTML elements when they do the job with less effort/code. You should use JS when they don’t.