3 ms·
Thanks for sharing your perspective on this. Does anyone know if the web platform now provides a foolproof way to clear all default styling on a button or othe
by mwcampbell 6y ago
Thanks for sharing your perspective on this.
Does anyone know if the web platform now provides a foolproof way to clear all default styling on a button or other standard control?
- crisnoble 6y ago`appearance: none;` gets you a long way
- plussed_reader 6y agoBut muh ableist design preferences....
- mwcampbell 6y agoPlease avoid this kind of unconstructive snark. I'm prone to it myself when discussing this subject, but I try to avoid it when discussing accessibility with a broad audience like HN. I want to meet mainstream developers where they are, figure out what prevents them from making their applications accessible, and do something about it, not just guilt-trip them.
- crisnoble 6y agoI actually use <button> with appearance:none specifically for accessibility. You get all of the benefits of a button's accessibility, focus, click events, normal tabbing, etc, and can use them for things like toggling an accordion of content or showing/hiding a mobile menu. Better than a div because you don't need aria-role, and better than a link because it is not taking you anywhere. As pointed out up thread, developers and designers often skip using <button> because it is hard to style just right. Using appearance:none resets the style but not the accessibility behavior.
- no_wizard 6y agoYes. This is a good article from CSS Tricks on the subject matter, which describes it all better than I could. https://css-tricks.com/custom-styling-form-inputs-with-modern-css-features/ https://css-tricks.com/custom-styling-form-inputs-with-moder...