-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
doc: adopt MDN style for kbd elements #35460
Conversation
There is also a different style proposed by @devsnek that renders like this: We'd want to tweak it a tiny bit if we go with that. The Tab key rendering overlays a bit of the line below it. And we probably would want to get rid of the |
Hiding this to keep the conversation-with-myself easier to follow, as this comment is resolved below.I tried to ascertain from https://developer.mozilla.org/en-US/docs/MDN/About if there is any licensing issue from copying a few lines of CSS from MDN. Does this 10-ish lines of CSS material warrants a Creative Commons attribution? Any uncertainty there would be an argument for using @devsnek's style instead (or sticking with what we have and maybe adding a drop-shadow as @silverwind suggested). |
And, for completeness, here's GitHub style that @bnb suggested as a possibility: |
Licensing issue solved. Since their code samples are public domain, I grabbed their public domain CSS for the kbd element in the first code snippet/sample at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd. It's a little bit different from the CSS on their website, but only a little bit. Here's the rendering: |
#35460 (comment) looks pretty good (and unique) to me but it needs a bit less padding and a bit more border-radius. On the MDN one, I don't really like the white top-padding. |
PR-URL: nodejs#35460 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in cd226c0 |
I'll open a follow-on PR to deal with the padding and perhaps include elements of @devsnek's proposed style too (unless they do it first or something). |
Hmmm...actually, the white padding is a box shadow that is vastly more subtle when not zoomed in like the screenshot...maybe it's fine. Definitely want to get the keys more aligned with the |
PR-URL: #35460 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#35460 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Before:
After:
The previous "After" version"
After: