←back to thread

Just use a button

(gomakethings.com)
285 points moebrowne | 1 comments | | HN request time: 0.21s | source
Show context
SmartHypercube ◴[] No.45775351[source]
I got bitten by this: user agent stylesheet contains "button {align-items: flex-start}" (at least in Chrome). The default behavior is "stretch". Spent an hour debugging why my flexboxs' sizes are wrong. I still want to use correct HTML elements as much as possible, but I do think using <div>s everywhere makes my small side projects so much easier, since I don't have to remember all the non-default behaviors.
replies(2): >>45775930 #>>45776129 #
crisnoble ◴[] No.45776129[source]
`appearance: none` goes a long way to resetting button styles. I usually make a .unbuttonify class to use or extend for things I want to behave like buttons (free focus, accessibility, and interactivity) but look like, say, a hamburger menu toggle.
replies(1): >>45776466 #
1. culi ◴[] No.45776466[source]
are css resets not in vogue any more? I still use them for all my side projects. As well as a normalize.css[0] that smooths over any additional browser inconsistencies. The original Meyer reset is definitely overkill, but there are a couple newer more minimal ones out there[2][3]

[0] https://necolas.github.io/normalize.css/

[1] https://meyerweb.com/eric/tools/css/reset/

[2] https://www.joshwcomeau.com/css/custom-css-reset/

[3] https://piccalil.li/blog/a-more-modern-css-reset/