Merge pull request #1438 from tirtawr/add-keyboard-shortcut-note
Add keyboard shortcut note
This commit is contained in:
commit
b2877f4b3a
3 changed files with 112 additions and 86 deletions
|
@ -3,17 +3,16 @@ import { metaKeyName, } from '../../../utils/metaKey';
|
|||
|
||||
function KeyboardShortcutModal() {
|
||||
return (
|
||||
<ul className="keyboard-shortcuts" title="keyboard shortcuts">
|
||||
<div className="keyboard-shortcuts">
|
||||
<h3 className="keyboard-shortcuts__title">Code Editing</h3>
|
||||
<p className="keyboard-shortcuts__description">
|
||||
Code editing keyboard shortcuts follow <a href="https://shortcuts.design/toolspage-sublimetext.html" target="_blank" rel="noopener noreferrer">Sublime Text shortcuts</a>.
|
||||
</p>
|
||||
<ul className="keyboard-shortcuts__list">
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">{'\u21E7'} + Tab</span>
|
||||
<span>Tidy</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{metaKeyName} + S
|
||||
</span>
|
||||
<span>Save</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{metaKeyName} + F
|
||||
|
@ -50,6 +49,15 @@ function KeyboardShortcutModal() {
|
|||
</span>
|
||||
<span>Comment Line</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3 className="keyboard-shortcuts__title">General</h3>
|
||||
<ul className="keyboard-shortcuts__list">
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{metaKeyName} + S
|
||||
</span>
|
||||
<span>Save</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{metaKeyName} + Enter
|
||||
|
@ -74,19 +82,8 @@ function KeyboardShortcutModal() {
|
|||
</span>
|
||||
<span>Turn off Accessible Output</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
{metaKeyName} + B
|
||||
</span>
|
||||
<span>Toggle Sidebar</span>
|
||||
</li>
|
||||
<li className="keyboard-shortcut-item">
|
||||
<span className="keyboard-shortcut__command">
|
||||
Ctrl + `
|
||||
</span>
|
||||
<span>Toggle Console</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ h2 {
|
|||
|
||||
h3 {
|
||||
font-weight: normal;
|
||||
font-size: #{16 / $base-font-size}rem;
|
||||
}
|
||||
h4 {
|
||||
font-weight: normal;
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
width: #{450 / $base-font-size}rem;
|
||||
}
|
||||
|
||||
.keyboard-shortcuts-note {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.keyboard-shortcut-item {
|
||||
display: flex;
|
||||
& + & {
|
||||
|
@ -13,8 +18,31 @@
|
|||
}
|
||||
|
||||
.keyboard-shortcut__command {
|
||||
width: 50%;
|
||||
font-weight: bold;
|
||||
text-align: right;
|
||||
padding-right: #{10 / $base-font-size}rem;
|
||||
margin-right: #{10 / $base-font-size}rem;
|
||||
padding: #{3 / $base-font-size}rem;
|
||||
@include themify {
|
||||
border: 1px solid getThemifyVariable("button-border-color");
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard-shortcuts__title {
|
||||
padding-bottom: #{10 / $base-font-size}rem;
|
||||
}
|
||||
|
||||
.keyboard-shortcuts__description {
|
||||
padding-bottom: #{10 / $base-font-size}rem;
|
||||
}
|
||||
|
||||
.keyboard-shortcuts__list:not(:last-of-type) {
|
||||
padding-bottom: #{10 / $base-font-size}rem;
|
||||
}
|
||||
|
||||
.keyboard-shortcuts__title:not(:first-of-type) {
|
||||
@include themify() {
|
||||
border-top: 1px dashed getThemifyVariable("button-border-color");
|
||||
padding-top: #{10 / $base-font-size}rem;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue