From ef9b5c41a58e218d23ab0154ac4f9c4a89bcf8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 16 Mar 2022 15:33:00 +0100 Subject: [PATCH] Move `KeyboardShortcut` styling into a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- res/css/_components.scss | 1 + res/css/views/settings/_KeyboardShortcut.scss | 36 +++++++++++++++++++ .../tabs/user/_KeyboardUserSettingsTab.scss | 18 ---------- .../views/settings/KeyboardShortcut.tsx | 2 +- 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 res/css/views/settings/_KeyboardShortcut.scss diff --git a/res/css/_components.scss b/res/css/_components.scss index a5ff7e233f85..fbff60879081 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -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"; diff --git a/res/css/views/settings/_KeyboardShortcut.scss b/res/css/views/settings/_KeyboardShortcut.scss new file mode 100644 index 000000000000..d3ca6cc94358 --- /dev/null +++ b/res/css/views/settings/_KeyboardShortcut.scss @@ -0,0 +1,36 @@ +/* +Copyright 2020 The Matrix.org Foundation C.I.C. +Copyright 2021 Šimon Brandner + +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; + } + } +} diff --git a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss index 5afd2b664d0e..c72518267507 100644 --- a/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss +++ b/res/css/views/settings/tabs/user/_KeyboardUserSettingsTab.scss @@ -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; - } - } } diff --git a/src/components/views/settings/KeyboardShortcut.tsx b/src/components/views/settings/KeyboardShortcut.tsx index 8863979a28db..14dcf77d241d 100644 --- a/src/components/views/settings/KeyboardShortcut.tsx +++ b/src/components/views/settings/KeyboardShortcut.tsx @@ -58,7 +58,7 @@ export const KeyboardShortcut: React.FC = ({ value }) => modifiersElement.push(); } - return
+ return
{ modifiersElement }
;