-
Notifications
You must be signed in to change notification settings - Fork 61
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
Clarify the meaning of button in the docs #158
base: main
Are you sure you want to change the base?
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
Codecov ReportAll modified lines are covered by tests ✅ see 1 file with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
Heya cheers, the reason they are links, is because sphinx does not have a "concept" of buttons, i.e. no built-in nodes for them. It may be difficult to work around this limitation, without any upstream changes in sphinx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some inline comments to help with review
@@ -139,8 +161,6 @@ Use the `click-parent` option to make the button's parent container also clickab | |||
|
|||
::: | |||
|
|||
See the [Material Design](https://material.io/components/buttons) and [Bootstrap](https://getbootstrap.com/docs/5.0/components/buttons/) descriptions for further details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the link to Material Design here because I couldn't actually figure out how it was related to this section. I mean, I understand that Sphinx Design either depends on or takes inspiration from Material Design, but I just couldn't figure out how the information on the page about Material Buttons was supposed to help me use the SD directives, button-link
and button-ref
, documented here.
I moved the link to Bootstrap buttons up near the top and in a context that I'm hoping makes it seem more like an optional and auxiliary reference than it does here.
I also got feedback from one of my colleagues that these links (which take you to docs about buttons) made it harder to determine from this section of the SD docs if SD buttons were supposed to be buttons or links.
(buttons)= | ||
## Buttons | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to add this in order to get the tests to pass, otherwise I would get:
WARNING: 'any' reference target not found: buttons
.. _buttons: | ||
|
||
Buttons | ||
....... | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto for this. Added to make tests pass. Patterned after the card-link snippet
Looks like some change in sphinx is messing up all the tests, I'll have a look |
Thank you 🙏 |
Yeah, but I actually think it would be a mistake to output either of Sphinx Design's The question I'm getting at is whether it's a good idea for these components to even exist. From an accessibility standpoint, especially when we think of cognitive accessibility and making intuitive, standards-based graphical interfaces, if there is a clear and valid semantic distinction between links and buttons and we want to keep that semantic distinction clear (a lot of assumptions here), then I think it's a mistake to make links look like buttons, or vice versa, to make buttons look like links. Their visual styles should be respectively distinct so as to reenforce the semantic and UX/behavioral distinctions between the two. My cynical take is that links that look like buttons on the web are more the result of marketing teams wanting to increase click-through rates rather than careful usability considerations. Granted, I can imagine that there are edge cases where one could argue for making a link look like a button. I tried to use language in the docs that accords with all of this without going too deep into the details. |
Gentle bump. Is there anything I can do to help this along? |
This pull request seeks to clarify the relationship between Sphinx Design buttons and HTML buttons.
It updates the language in the docs. It also fixes an issue where some of the button examples were not inclued in the accompanying code snippet.
Here's the backstory. This came up for us over at Pydata Sphinx Theme (PST) as we were fixing accessibility issues. We realized that the PST buttons were not actually being output in HTML as
<button>
s. When I dug in, I realized that the buttons in PST were actually from Sphinx Design. Then I realized that the Sphinx Design buttons were not actually buttons, not in the HTML sense; they're actually links, and therefore it makes sense to use<a>
tags rather than<button>
tags. That said, I felt there was room for improvement in the docs to make this point clearer, so I created this PR.There is a separate, related accessibility question about whether links should be styled to look like buttons, but that would require backwards-incompatible changes.
For more information, please refer to Ashlee M Boyer's post, Should I Use a Button or a Link?