Skip to content

Commit 6384c63

Browse files
committed
Fixes #1386 - Add headers to keyboard shortcut modal, add styling to keyboard commands in list
1 parent 081b1ab commit 6384c63

File tree

3 files changed

+41
-13
lines changed

3 files changed

+41
-13
lines changed

client/modules/IDE/components/KeyboardShortcutModal.jsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ import { metaKeyName, } from '../../../utils/metaKey';
44
function KeyboardShortcutModal() {
55
return (
66
<div className="keyboard-shortcuts">
7-
<div className="keyboard-shortcuts-note">
8-
<strong>Note:</strong> our keyboard shortcuts follow <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">Sublime Text shortcuts</a>
9-
</div>
10-
<ul title="keyboard shortcuts">
7+
<h3 className="keyboard-shortcuts__title">Code Editing</h3>
8+
<p className="keyboard-shortcuts__description">
9+
Code editing keyboard shortcuts follow <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">Sublime Text shortcuts</a>.
10+
</p>
11+
<ul className="keyboard-shortcuts__list">
1112
<li className="keyboard-shortcut-item">
1213
<span className="keyboard-shortcut__command">{'\u21E7'} + Tab</span>
1314
<span>Tidy</span>
1415
</li>
15-
<li className="keyboard-shortcut-item">
16-
<span className="keyboard-shortcut__command">
17-
{metaKeyName} + S
18-
</span>
19-
<span>Save</span>
20-
</li>
2116
<li className="keyboard-shortcut-item">
2217
<span className="keyboard-shortcut__command">
2318
{metaKeyName} + F
@@ -54,6 +49,15 @@ function KeyboardShortcutModal() {
5449
</span>
5550
<span>Comment Line</span>
5651
</li>
52+
</ul>
53+
<h3 className="keyboard-shortcuts__title">General</h3>
54+
<ul className="keyboard-shortcuts__list">
55+
<li className="keyboard-shortcut-item">
56+
<span className="keyboard-shortcut__command">
57+
{metaKeyName} + S
58+
</span>
59+
<span>Save</span>
60+
</li>
5761
<li className="keyboard-shortcut-item">
5862
<span className="keyboard-shortcut__command">
5963
{metaKeyName} + Enter
@@ -83,4 +87,4 @@ function KeyboardShortcutModal() {
8387
);
8488
}
8589

86-
export default KeyboardShortcutModal;
90+
export default KeyboardShortcutModal;

client/styles/base/_base.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ h2 {
7474

7575
h3 {
7676
font-weight: normal;
77+
font-size: #{16 / $base-font-size}rem;
7778
}
7879
h4 {
7980
font-weight: normal;

client/styles/components/_keyboard-shortcuts.scss

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,31 @@
1818
}
1919

2020
.keyboard-shortcut__command {
21-
width: 50%;
2221
font-weight: bold;
2322
text-align: right;
24-
padding-right: #{10 / $base-font-size}rem;
23+
margin-right: #{10 / $base-font-size}rem;
24+
padding: #{3 / $base-font-size}rem;
25+
@include themify {
26+
border: 1px solid getThemifyVariable("button-border-color");
27+
border-radius: 3px;
28+
}
29+
}
30+
31+
.keyboard-shortcuts__title {
32+
padding-bottom: #{10 / $base-font-size}rem;
33+
}
34+
35+
.keyboard-shortcuts__description {
36+
padding-bottom: #{10 / $base-font-size}rem;
37+
}
38+
39+
.keyboard-shortcuts__list:not(:last-of-type) {
40+
padding-bottom: #{10 / $base-font-size}rem;
41+
}
42+
43+
.keyboard-shortcuts__title:not(:first-of-type) {
44+
@include themify() {
45+
border-top: 1px dashed getThemifyVariable("button-border-color");
46+
padding-top: #{10 / $base-font-size}rem;
47+
}
2548
}

0 commit comments

Comments
 (0)