Skip to content
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

Feature Suggestion: Keyboard Keys Rendering #1813

Closed
epomatti opened this issue Jun 1, 2022 · 7 comments · Fixed by #1906
Closed

Feature Suggestion: Keyboard Keys Rendering #1813

epomatti opened this issue Jun 1, 2022 · 7 comments · Fixed by #1906
Labels
A-Style Area: Style (CSS, etc.)

Comments

@epomatti
Copy link

epomatti commented Jun 1, 2022

It would be nice to have keyboards key markup like this:

Ctrl + Alt + Space

@ehuss ehuss added the A-Style Area: Style (CSS, etc.) label Jun 1, 2022
@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 22, 2022

Can/should we use the same style entirely, or should we come up with something similar?

@epomatti
Copy link
Author

hmmm what is "same style"?

@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 22, 2022

The style applied to <kbd> elements on GitHub. I'm not sure if we would be able to copy their CSS; if not, I'm no good designer, so I would have trouble coming up with something similar but different.

@epomatti
Copy link
Author

Maintainability comes first then, simpler would be a better choice.

@ISSOtm
Copy link
Contributor

ISSOtm commented Jun 23, 2022

My question isn't so much about maintainability as it is about copyright.

@epomatti
Copy link
Author

I wouldn't take any risk on that and the time looking it up is not worth it.

It should be custom but shouldn't be hard (the style). A span with rounded and shadow, all of which are native to CSS and can be made to look exactly like the styles in here.

It would have to be theme-aware, behave nicely on zoom, match with other styles such as bold and italic, etc, the usual stuff.

@brettchalupa
Copy link
Contributor

I'd like to take on this issue if it's still available.

brettchalupa added a commit to brettchalupa/mdBook that referenced this issue Oct 6, 2022
Allows for special styles to call them out since they're different than
normal text and different than code. They can make use of styles they
inherit for font style and weight.

Notes on changes:

- Added new CSS variables for reused elements
- The font-* rules are separate for each aspect so that they can inherit
  bold/italic/etc

Closes rust-lang#1813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Style Area: Style (CSS, etc.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants