Remix.run Logo
clintonc 2 days ago

<button type="button" class="download-hover" onclick="location.href='https://github.com/zellij-org/zellij/releases/latest/downloa...'"> linux download </button>

Screaming into the void, I guess, but PSA. Don't use buttons for links. In my case, I couldn't right-click and copy the URL, but there are a lot of other reasons not to do this.

patates 2 days ago | parent | next [-]

It also breaks a lot of a11y tooling. It really helps a lot of people when developers care about semantic html.

I personally suggest web devs to install axe devtools [0] in their dev browser profile. Also, LLMs have gotten to the point that even the small local models can help a lot [1].

[0]: https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/

[1]: Gemma 4: https://pastebin.com/Mjm1Vx4C

miki123211 a day ago | parent | prev | next [-]

Whether this should be a button or link from an A11Y perspective is... kind of up in the air.

There's an argument that links are "portals" that take you somewhere, while buttons cause some action to happen, Whether you treat a file as a resource (which your browser just chooses to save on disk instead of rendering on screen), or whether you treat it as an explicit "download" action, is a matter of semantics I guess.

rpastuszak a day ago | parent | next [-]

<a href='...' download>...</a>

em-bee 18 hours ago | parent | prev [-]

you can style a link to look like a button if you care about the difference.

but traditionally, references to files are links, and it is up to the browser what to do with them (whether to just download them or to download and then display them). that's what all links are. that's the whole point of hypertext. every link causes the browser to make a request to a server and fetch something. buttons are for activating things, not for downloading.

interstice 21 hours ago | parent | prev [-]

I've often wondered.. Why _do_ people do this? For one thing it's more code than the alternative