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

Commit

Permalink
Move KeyboardShortcut styling into a separate file
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed Mar 16, 2022
1 parent e73a70e commit ef9b5c4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
@import "./views/settings/_ImageSizePanel.scss";
@import "./views/settings/_IntegrationManager.scss";
@import "./views/settings/_JoinRuleSettings.scss";
@import "./views/settings/_KeyboardShortcut.scss";
@import "./views/settings/_LayoutSwitcher.scss";
@import "./views/settings/_Notifications.scss";
@import "./views/settings/_PhoneNumbers.scss";
Expand Down
36 changes: 36 additions & 0 deletions res/css/views/settings/_KeyboardShortcut.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2021 Šimon Brandner <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_KeyboardShortcut {
kbd {
padding: 5px;
border-radius: 4px;
background-color: $header-panel-bg-color;
margin-right: 5px;
min-width: 20px;
text-align: center;
display: inline-block;
border: 1px solid $kbd-border-color;
box-shadow: 0 2px $kbd-border-color;
margin-bottom: 4px;
text-transform: capitalize;

& + kbd {
margin-left: 5px;
}
}
}
18 changes: 0 additions & 18 deletions res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,4 @@ limitations under the License.

margin: 4px 0;
}

kbd {
padding: 5px;
border-radius: 4px;
background-color: $header-panel-bg-color;
margin-right: 5px;
min-width: 20px;
text-align: center;
display: inline-block;
border: 1px solid $kbd-border-color;
box-shadow: 0 2px $kbd-border-color;
margin-bottom: 4px;
text-transform: capitalize;

& + kbd {
margin-left: 5px;
}
}
}
2 changes: 1 addition & 1 deletion src/components/views/settings/KeyboardShortcut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const KeyboardShortcut: React.FC<IKeyboardShortcutProps> = ({ value }) =>
modifiersElement.push(<KeyboardKey key="shiftKey" name={Key.SHIFT} />);
}

return <div>
return <div className="mx_KeyboardShortcut">
{ modifiersElement }
<KeyboardKey name={value.key} last />
</div>;
Expand Down

0 comments on commit ef9b5c4

Please sign in to comment.