steveklabnik / rustdoc

Not a real thing, see https://github.com/rust-lang/rust for rustdoc's actual source code
https://github.com/rust-lang/rust
104 stars 22 forks source link

Proper kbd-tag style #221

Open hellow554 opened 6 years ago

hellow554 commented 6 years ago

I'd like to see <kbd>A</kbd> tags to be formatted like "real" keys, e.g. here on github A or like on stackexchange or in any other possible way :)

steveklabnik commented 6 years ago

TIL about this tag: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd

callahad commented 6 years ago

I can't resist. I'm sorry.

As mentioned on MDN, a "proper" kbd tag style would actually use <kbd><kbd>A</kbd></kbd> for key presses, but nobody writes their CSS to style that properly: A. And the HTML spec itself was even inconsistent in its own use of the tag: https://github.com/whatwg/html/pull/2363

...but pragmatically, GitHub, StackExchange, etc. all (incorrectly!) style the single <kbd> as a button, so you might as well follow suit :(

mgattozzi commented 6 years ago

...but pragmatically, GitHub, StackExchange, etc. all (incorrectly!) style the single <kbd> as a button, so you might as well follow suit :(

When the implementation becomes the spec. Maybe being able to handle them both properly would probably be best.