3 ms·
It doesn't say to make the -webkit-appearance value 'button', that's the default. Change it to 'none'. Look at the first embedded Codepen, note it also has a -m
by extra88 6y ago
It doesn't say to make the -webkit-appearance value 'button', that's the default. Change it to 'none'. Look at the first embedded Codepen, note it also has a -moz-appearance: none, it's not just Safari.
I don't understand why someone would want to add multiple attributes plus a JavaScript keypress listener to the wrong element when you can instead add basically reusable "reset" CSS to the right element (<button>).
You're making choices for the people using a site. If you use a <button> and don't get the CSS right, it doesn't always look the way you'd like for some people; if you don't use a <button> and an attribute or the JavaScript is wrong, it doesn't work at all for some people.
You don't have total control over the appearance of everything in the browser anyway. Some people want or need to make changes (higher contrast, more readable font, etc.) to use the web and not using appropriate elements just makes it harder for them to do that.
https://codepen.io/andybelldesign/pen/Vxpjvo https://codepen.io/andybelldesign/pen/Vxpjvo
- LeonB 6y agoIt sounds like you almost saw that there are trade offs involved in the two different approaches. But then just went for pejorative terms a bit more. There are some scenarios where total control of the style is an important part of the thing being built. I’m closing the browser now. I do appreciate the many constructive parts of what you’ve said. The preaching about what’s “wrong” I can skip. Like there’s some grand moral imperative not to connect a click handler to a div. Spare me!
- rado 6y agoThe click handler won't work with keyboard and who knows what else, which means broken accessibility, This is actually a moral issue (you shouldn't decide which people to exclude), as well as legal in some territories. And the button can be styles pixel perfect easily, as explained above.