FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: implement fancier rendering for keys by Trott · Pull Request #35400 · nodejs/node · GitHub

/ node Public

doc: implement fancier rendering for keys - #35400

Merged
Trott merged 1 commit into
nodejs:masterfrom
Trott:kbd-render
Oct 2, 2020
Merged

doc: implement fancier rendering for keys#35400
Trott merged 1 commit into
nodejs:masterfrom
Trott:kbd-render

Conversation

Trott commented Sep 28, 2020

Copy link
Copy Markdown
Member

Minimal CSS and markup changes to implement special rendering for
<kbd> elements.

Checklist

nodejs-github-bot added doc Issues and PRs related to the documentations. repl Issues and PRs related to the REPL subsystem. labels Sep 28, 2020

Trott commented Sep 28, 2020

Copy link
Copy Markdown
Member Author

Before:

After:

Trott commented Sep 28, 2020

Copy link
Copy Markdown
Member Author

@nodejs/website What do people think of this? @devsnek suggested it in another PR, and I kind of like it, but also like the simplicity of simply bolding the key name and leaving it at that (the "before" state above). On the other hand, we could go even further and copy the CSS for the <kbd> used by MDN, which I rather like and renders like this:

devsnek commented Sep 28, 2020

Copy link
Copy Markdown
Member

Also this https://snek.dev/keyboard

Copy link
Copy Markdown
Member

I like the MDN style personally, but I notice they're also wrapping the whole keystroke in an <kbd> as well https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd#Representing_keystrokes_within_an_input

bnb commented Sep 28, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

I generally like the MDN / GitHub style (see below). I'm generally fine with any of the proposed solutions, though.

GitHub Style

Trott commented Sep 28, 2020

Copy link
Copy Markdown
Member Author

I like the MDN style personally, but I notice they're also wrapping the whole keystroke in an <kbd> as well

Yeah, the standard says that's optional (apparently for clarity) and that "Such precision isn't necessary". I like it semantically, but dislike it from a making-our-markdown-even-more-complex standpoint. I can go either way.

nschonni commented Sep 28, 2020
edited
Loading

Copy link
Copy Markdown
Member

Side thought, this could probably be "enforced" through the remark-node-preset by looking for a regex

Copy link
Copy Markdown
Contributor

Would also suggest either copying MDN style or adding a subtle box-shadow below so it looks like a key.

Minimal CSS and markup changes to implement special rendering for
`<kbd>` elements.

PR-URL: nodejs#35400
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>

Trott commented Oct 2, 2020

Copy link
Copy Markdown
Member Author

Landed in aa3746d

Trott merged commit aa3746d into nodejs:master Oct 2, 2020
Trott deleted the kbd-render branch October 2, 2020 10:28
danielleadams pushed a commit that referenced this pull request Oct 6, 2020
Minimal CSS and markup changes to implement special rendering for
`<kbd>` elements.

PR-URL: #35400
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
danielleadams mentioned this pull request Oct 6, 2020
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Minimal CSS and markup changes to implement special rendering for
`<kbd>` elements.

PR-URL: nodejs#35400
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL