Skip to content

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

@Trott 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 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

Trott commented Sep 28, 2020

Copy link
Copy Markdown
Member Author

Before:
image

After:
image

@Trott

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:

image

@devsnek

devsnek commented Sep 28, 2020

Copy link
Copy Markdown
Member

Also this https://snek.dev/keyboard

@nschonni

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

bnb commented Sep 28, 2020

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

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

nschonni commented Sep 28, 2020

Copy link
Copy Markdown
Member

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

@silverwind

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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
@Trott

Trott commented Oct 2, 2020

Copy link
Copy Markdown
Member Author

Landed in aa3746d

@Trott Trott merged commit aa3746d into nodejs:master Oct 2, 2020
@Trott 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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
@danielleadams 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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
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