Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cdfa60

Browse filesBrowse files
committed
feat(css): distinctive <kbd>
Problem: `<kbd>` doesn't look meaningfully different than `<pre>` and `<code>`. Solution: Adjust `<kbd>` styling so it represent user input (mappings, key chords, etc).
1 parent 21ac8b5 commit 3cdfa60
Copy full SHA for 3cdfa60

File tree

Expand file treeCollapse file tree

1 file changed

+22
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+22
-2
lines changed

‎css/main.css

Copy file name to clipboardExpand all lines: css/main.css
+22-2Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
/* Hue is between neovim green and blue for text/background */
1313
/* Saturation is low */
1414
--fg-color: #29332f;
15-
--bg-color:#e7eee8;
15+
--inverse-fg-color: #a9d5c4; /* Dark-mode fg color. */
16+
--bg-color: #e7eee8;
1617
--link-color: #195174;
1718
--accent-color: #000;
1819
--accent-bg-color: #d3e4db;
@@ -22,6 +23,7 @@
2223
@media (prefers-color-scheme: dark) {
2324
:root {
2425
--fg-color: #a9d5c4;
26+
--inverse-fg-color: #29332f; /* Light-mode fg color. */
2527
--bg-color: #0f191f;
2628
--accent-bg-color: #0b151b;
2729
--border-color: #1174b1;
@@ -147,9 +149,27 @@ pre {
147149
word-break: normal;
148150
}
149151

152+
/* Keyboard input should be distinctive from <pre> and <code>. */
153+
kbd {
154+
box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0px 0px 0px 2px #ffffff;
155+
color: var(--accent-color);
156+
background-color: #ebebeb; /* var(--accent-bg-color); */
157+
border: 1pt solid var(--border-color); /* #555 */
158+
border-radius: 3px; /* rounded corners */
159+
padding: 2px 5px;
160+
}
161+
162+
@media (prefers-color-scheme: dark) {
163+
kbd {
164+
box-shadow: 2px 2px 4px var(--border-color), inset 0px 0px 0px 2px rgba(255,255,255,0.2);
165+
color: var(--fg-color);
166+
background-color: var(--accent-bg-color);
167+
border: 1pt solid var(--fg-color); /* #555 */
168+
}
169+
}
170+
150171
code,
151172
pre,
152-
kbd,
153173
samp {
154174
background-color: var(--accent-bg-color);
155175
color: var(--fg-color);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.