mblode / marx

The classless CSS reset (perfect for Communists).
https://mblode.github.io/marx/
MIT License
1.69k stars 101 forks source link

Fix link button styling #62

Open troxler opened 2 years ago

troxler commented 2 years ago

Describe the bug Link buttons in the demo are using invalid HTML. Nesting buttons within links is invalid and semantically incorrect.

To Reproduce The demo is using <a href="#"><button>Button Link</button></a> for link buttons.

Expected behavior Valid HTML.

Additional context I maintain a list of CSS frameworks where Marx is listed. Using valid HTML and proper semantics is a requirement to be listed.

troxler commented 2 years ago

For the record: I removed Marx from the list for now. https://github.com/troxler/awesome-css-frameworks/commit/910446bbebb303a448f13c29404fda0bbbd2ce12

heller commented 2 years ago

Hi @troxler, what makes you say the HTML is invalid?

According to MDN,

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button [2] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#phrasing_content

troxler commented 2 years ago

The content model of the a element specification defines that "there must be no interactive content descendant". A button—among other elements—is interactive content.

heller commented 2 years ago

Thanks! Today I learned. I'm not the maintainer but it should be pretty easy for you to open a pull request that removes the link button example.

devnewton commented 2 years ago

This should do the job: https://github.com/mblode/marx/pull/64