6 ms·
The theme toggle button plays a sound when you click it. So not only does this require state for the theme, but also the sound. Also curious is that clicking th
by memco 6y ago
The theme toggle button plays a sound when you click it. So not only does this require state for the theme, but also the sound. Also curious is that clicking the button to mute sound plays a sound.
I believe every OS defaults to silent actions for every button. Games, on the other hand, often have sounds for hover/focus and click. I'm not sure what's the better option, but if we're going to default to the OS for theme choice shouldn't we also default to the OS for UI sound choice? I don't know if there's any way to check that via CSS or JS. But I hope that if sites are going to start implementing this more often that browsers at least expose an API with a user preference if not the OS.
- danappelxx 6y agosee: https://www.joshwcomeau.com/react/announcing-use-sound-react-hook/ https://www.joshwcomeau.com/react/announcing-use-sound-react...
- memco 6y agoThanks! I did see this before. Didn't realize it was the same dev. They don't address that Desktop OSes don't do sound for most things and also, I'm not really sure I see sound used a lot in mobile apps, but maybe that's just the apps I use? I think I would personally want more research and discussion on this before I ventured down this path, but it is an interesting idea.