Consider retiring inline code snippets #11110
mbgower
started this conversation in
Accessibility
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's my question on the inline code snippet variant. Is it of value?
I conjecture that an inline code snippet's primary purpose is really text formatting, and that it's rarely used for copying. If Carbon removed it, folks would just use formatting to show code, and where copying was desired, use to the single-line version, which is more robust to user settings and, I suspect is far more commonly used where copying the snippet is a functional consideration. Has anyone done any study to determine how often the inline is used intentionally for interaction, as compared to the single-line snippet?
Another consideration is that the code snippet can be made non-copyable, meaning the inline version is identical to just using code markup/down.
Further, it's not supposed to be used where the inline code extends over multiple lines. But the author has no control of where the snippet may end up if users alter their text size, breakpoint, etc.
I'm raising this because there are some accessibility challenges with the inline code snippet. It is programmatically a button, but the button's function is to copy the text of the button. So to convey both its copy function and what is being copied, you have to concatenate the strings. It's awkward to make work well consistently, especially with localization.
I'd suggest exploring retiring inline and only providing single-line and multi-line variants.
Beta Was this translation helpful? Give feedback.
All reactions