Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix link button styling #62

Open
troxler opened this issue Jan 27, 2022 · 5 comments
Open

Fix link button styling #62

troxler opened this issue Jan 27, 2022 · 5 comments

Comments

@troxler
Copy link

troxler commented Jan 27, 2022

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 added a commit to troxler/awesome-css-frameworks that referenced this issue Feb 18, 2022
@troxler
Copy link
Author

troxler commented Feb 18, 2022

For the record: I removed Marx from the list for now.
troxler/awesome-css-frameworks@910446b

@heller
Copy link

heller commented Feb 25, 2022

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

According to MDN,

  • a <button> counts as "phrasing content" and may be placed within any element that accepts "phrasing content" [1]
  • the <a> tag supports "phrasing content" as long as there's not also non-phrasing content [2]

[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
Copy link
Author

troxler commented Feb 25, 2022

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
Copy link

heller commented Feb 25, 2022

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
Copy link

This should do the job: #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants