Proposal: delete the MDNButton macro

I’ve been doing some cleanup of our macros, and I’d like to delete the MDNButton macro.

It makes a big green button containing a link (not actually a <button>, just a styled <div>). It’s used in 4 en-US pages (and many translations of them): https://developer.mozilla.org/en-US/search?locale=en-US&kumascript_macros=MDNButton&topic=none.

One of these pages (the MDN Inbox) should just be deleted. I suppose that’s a sub-proposal here. The MDN Inbox was conceived as a way to accept unsolicited contributions. We never really got many, and never set up a reliable process for handling any contributions we did get.

That leaves 3 pages, 2 in the meta-docs and one in the glossary. I don’t think this is enough pages to justify implementing this as a macro.

We should decide whether we want to keep the big green button. IMO we should not, and should just use a link instead. But if we do want to keep the big green button, we could just use the HTML emitted by the macro (fixed so it works properly with the new narrower column width)?

3 Likes

Yes, I totally think we can get rid of this. And I wish we could use a proper <button> element, but I’m not sure if MDN security features allow that.

1 Like

<button> is not permitted from the editor, but I don’t know about macros (those are allowed some elements that the editor isn’t)

Also, the big green button is present on: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/45
Edit: That’s a different button.

Thanks for the replies!

Then: should I replace them with just a link (my preference , FWIW) or, more conservatively, replace them with the HTML the macro generates? Or a similar version that uses <button>, assuming I can do that?

Also, the big green button is present on: https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/45

Ah yes, that’s just a blob of inline CSS apparently :sob:

1 Like

Thanks! Heplp me, too.

Well, the {{MDNButton}} macro creates the following HTML on the linked pages:

<div class="align-center">
  <a href="${url}" class="ignore-external
     button mega positive">
    ${text}<div></div>
  </a>
</div>

The empty <div/> at the end is clearly a bug.

-> https://github.com/mdn/kumascript/pull/941