Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ef9b5c4

Browse files
committed
Move KeyboardShortcut styling into a separate file
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
1 parent e73a70e commit ef9b5c4

File tree

4 files changed

+38
-19
lines changed

4 files changed

+38
-19
lines changed

res/css/_components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
@import "./views/settings/_ImageSizePanel.scss";
276276
@import "./views/settings/_IntegrationManager.scss";
277277
@import "./views/settings/_JoinRuleSettings.scss";
278+
@import "./views/settings/_KeyboardShortcut.scss";
278279
@import "./views/settings/_LayoutSwitcher.scss";
279280
@import "./views/settings/_Notifications.scss";
280281
@import "./views/settings/_PhoneNumbers.scss";
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2020 The Matrix.org Foundation C.I.C.
3+
Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
.mx_KeyboardShortcut {
19+
kbd {
20+
padding: 5px;
21+
border-radius: 4px;
22+
background-color: $header-panel-bg-color;
23+
margin-right: 5px;
24+
min-width: 20px;
25+
text-align: center;
26+
display: inline-block;
27+
border: 1px solid $kbd-border-color;
28+
box-shadow: 0 2px $kbd-border-color;
29+
margin-bottom: 4px;
30+
text-transform: capitalize;
31+
32+
& + kbd {
33+
margin-left: 5px;
34+
}
35+
}
36+
}

res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,4 @@ limitations under the License.
3030

3131
margin: 4px 0;
3232
}
33-
34-
kbd {
35-
padding: 5px;
36-
border-radius: 4px;
37-
background-color: $header-panel-bg-color;
38-
margin-right: 5px;
39-
min-width: 20px;
40-
text-align: center;
41-
display: inline-block;
42-
border: 1px solid $kbd-border-color;
43-
box-shadow: 0 2px $kbd-border-color;
44-
margin-bottom: 4px;
45-
text-transform: capitalize;
46-
47-
& + kbd {
48-
margin-left: 5px;
49-
}
50-
}
5133
}

src/components/views/settings/KeyboardShortcut.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const KeyboardShortcut: React.FC<IKeyboardShortcutProps> = ({ value }) =>
5858
modifiersElement.push(<KeyboardKey key="shiftKey" name={Key.SHIFT} />);
5959
}
6060

61-
return <div>
61+
return <div className="mx_KeyboardShortcut">
6262
{ modifiersElement }
6363
<KeyboardKey name={value.key} last />
6464
</div>;

0 commit comments

Comments
 (0)