From cff506e832d3f992a9f314fe8a77020a1f973064 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Fri, 13 Nov 2020 11:50:57 -0800 Subject: [PATCH] Reduce custom CSS --- src/react-components/auth/SignInModal.js | 57 ++++++++++--------- src/react-components/auth/SignInModal.scss | 16 ------ src/react-components/auth/VerifyModal.js | 8 +-- src/react-components/auth/VerifyModal.scss | 7 --- src/react-components/input/InputField.scss | 2 + .../input/RadioInputField.stories.js | 34 ++++++----- src/react-components/layout/Column.js | 26 ++++++++- src/react-components/layout/Column.scss | 17 ++++++ .../layout/LoadingScreenLayout.scss | 8 --- src/react-components/modal/Modal.js | 2 +- src/react-components/modal/Modal.scss | 5 -- .../room/AutoExitWarningModal.js | 3 +- .../room/AutoExitWarningModal.scss | 3 - .../room/EnterOnDeviceModal.js | 23 ++++---- .../room/EnterOnDeviceModal.scss | 44 -------------- .../room/EnterOnDeviceModal.stories.js | 17 +++--- src/react-components/room/LeaveRoomModal.js | 3 +- src/react-components/room/LeaveRoomModal.scss | 9 --- .../room/MicPermissionsModal.js | 8 +-- .../room/MicPermissionsModal.scss | 13 ----- src/react-components/room/ObjectMenu.js | 2 +- src/react-components/room/ObjectMenu.scss | 5 -- .../room/PromoteClientModal.js | 3 +- .../room/PromoteClientModal.scss | 3 - src/react-components/room/RoomEntryModal.scss | 6 -- .../room/RoomSettingsSidebar.js | 52 ++++++++--------- .../room/UserProfileSidebar.js | 1 - .../room/UserProfileSidebar.scss | 8 --- src/react-components/sidebar/Sidebar.js | 2 +- src/react-components/sidebar/Sidebar.scss | 5 -- src/react-components/styles/global.scss | 41 +++++++++---- 31 files changed, 183 insertions(+), 250 deletions(-) delete mode 100644 src/react-components/auth/SignInModal.scss delete mode 100644 src/react-components/auth/VerifyModal.scss delete mode 100644 src/react-components/room/AutoExitWarningModal.scss delete mode 100644 src/react-components/room/LeaveRoomModal.scss delete mode 100644 src/react-components/room/PromoteClientModal.scss diff --git a/src/react-components/auth/SignInModal.js b/src/react-components/auth/SignInModal.js index 742d0f0c8c..d56adba026 100644 --- a/src/react-components/auth/SignInModal.js +++ b/src/react-components/auth/SignInModal.js @@ -3,7 +3,6 @@ import PropTypes from "prop-types"; import { CloseButton } from "../input/CloseButton"; import { Modal } from "../modal/Modal"; import { FormattedMessage } from "react-intl"; -import styles from "./SignInModal.scss"; import { Button } from "../input/Button"; import { TextInputField } from "../input/TextInputField"; import { Column } from "../layout/Column"; @@ -33,7 +32,7 @@ export function SubmitEmail({ onSubmitEmail, initialEmail, showPrivacy, privacyU ); return ( - +

{message || }

{(showTerms || showPrivacy) && ( - - By proceeding, you agree to the{" "} - {showTerms && ( - <> - - terms of use - {" "} - - )} - {showTerms && showPrivacy && "and "} - {showPrivacy && ( - - privacy notice - - )}. - +

+ + By proceeding, you agree to the{" "} + {showTerms && ( + <> + + terms of use + {" "} + + )} + {showTerms && showPrivacy && "and "} + {showPrivacy && ( + + privacy notice + + )}. + +

)} diff --git a/src/react-components/room/MicPermissionsModal.scss b/src/react-components/room/MicPermissionsModal.scss index e920a855eb..8a2cdadb9f 100644 --- a/src/react-components/room/MicPermissionsModal.scss +++ b/src/react-components/room/MicPermissionsModal.scss @@ -1,18 +1,5 @@ @use "../styles/theme.scss"; -:local(.content) { - h1 { - font-weight: theme.$font-weight-bold; - font-size: theme.$font-size-md; - } - - p { - font-size: theme.$font-size-sm; - font-weight: theme.$font-weight-medium; - line-height: 1.2; - } -} - :local(.error) { color: theme.$red; } diff --git a/src/react-components/room/ObjectMenu.js b/src/react-components/room/ObjectMenu.js index 6930d57c1f..a99ef76b09 100644 --- a/src/react-components/room/ObjectMenu.js +++ b/src/react-components/room/ObjectMenu.js @@ -43,7 +43,7 @@ export function ObjectMenu({ -

{title}

+
{title}
{joinChildren(children, () =>
)}
diff --git a/src/react-components/room/ObjectMenu.scss b/src/react-components/room/ObjectMenu.scss index 5f1186e4f1..36d663f1a3 100644 --- a/src/react-components/room/ObjectMenu.scss +++ b/src/react-components/room/ObjectMenu.scss @@ -56,11 +56,6 @@ align-items: center; justify-content: center; - h1 { - font-size: theme.$font-size-sm; - font-weight: theme.$font-weight-bold; - } - @media(min-width: theme.$breakpoint-md) { display: flex; } diff --git a/src/react-components/room/PromoteClientModal.js b/src/react-components/room/PromoteClientModal.js index 05ab65d443..70d3d5ef03 100644 --- a/src/react-components/room/PromoteClientModal.js +++ b/src/react-components/room/PromoteClientModal.js @@ -2,7 +2,6 @@ import React from "react"; import PropTypes from "prop-types"; import { FormattedMessage } from "react-intl"; import { Modal } from "../modal/Modal"; -import styles from "./PromoteClientModal.scss"; import { Button } from "../input/Button"; import { CloseButton } from "../input/CloseButton"; import { Column } from "../layout/Column"; @@ -10,7 +9,7 @@ import { Column } from "../layout/Column"; export function PromoteClientModal({ onClose, onConfirm, displayName }) { return ( }> - +

diff --git a/src/react-components/room/PromoteClientModal.scss b/src/react-components/room/PromoteClientModal.scss deleted file mode 100644 index 5059da19a1..0000000000 --- a/src/react-components/room/PromoteClientModal.scss +++ /dev/null @@ -1,3 +0,0 @@ -:local(.modal-content) { - line-height: 1.25; -} \ No newline at end of file diff --git a/src/react-components/room/RoomEntryModal.scss b/src/react-components/room/RoomEntryModal.scss index 3fa0f13e60..f1cc66d803 100644 --- a/src/react-components/room/RoomEntryModal.scss +++ b/src/react-components/room/RoomEntryModal.scss @@ -3,12 +3,6 @@ :local(.content) { padding: 24px 8px; - hr { - width: 100%; - border: none; - border-bottom: 1px solid theme.$grey; - } - button { width: 156px; } diff --git a/src/react-components/room/RoomSettingsSidebar.js b/src/react-components/room/RoomSettingsSidebar.js index 01760db201..942f32a545 100644 --- a/src/react-components/room/RoomSettingsSidebar.js +++ b/src/react-components/room/RoomSettingsSidebar.js @@ -129,34 +129,32 @@ export function RoomSettingsSidebar({ /> {entryMode === "invite" && ( -
- - {" "} - - - {" "} - /{" "} - - - - - ) : ( - - + + {" "} + + + {" "} + /{" "} + + - )) - } - fullWidth - /> -
+ + ) : ( + + + + )) + } + fullWidth + /> )} {showPublicRoomSetting && ( : } className={className} - contentClassName={styles.content} {...rest} > diff --git a/src/react-components/room/UserProfileSidebar.scss b/src/react-components/room/UserProfileSidebar.scss index 2f634e4fa5..991bdfb08f 100644 --- a/src/react-components/room/UserProfileSidebar.scss +++ b/src/react-components/room/UserProfileSidebar.scss @@ -1,13 +1,5 @@ @use "../styles/theme.scss"; -:local(.content) { - display: flex; - flex-direction: column; - align-items: center; - padding: 24px; - text-align: center; -} - :local(.avatar-preview-container) { display: flex; flex-direction: column; diff --git a/src/react-components/sidebar/Sidebar.js b/src/react-components/sidebar/Sidebar.js index 2b3981f919..f345101893 100644 --- a/src/react-components/sidebar/Sidebar.js +++ b/src/react-components/sidebar/Sidebar.js @@ -9,7 +9,7 @@ export function Sidebar({ title, beforeTitle, afterTitle, children, contentClass {(title || beforeTitle || afterTitle) && (
{beforeTitle}
-

{title}

+
{title}
{afterTitle}
)} diff --git a/src/react-components/sidebar/Sidebar.scss b/src/react-components/sidebar/Sidebar.scss index 92bcb47c23..b39a76783c 100644 --- a/src/react-components/sidebar/Sidebar.scss +++ b/src/react-components/sidebar/Sidebar.scss @@ -20,11 +20,6 @@ border-bottom: 1px solid theme.$lightgrey; align-items: center; justify-content: center; - - h1 { - font-size: theme.$font-size-sm; - font-weight: theme.$font-weight-bold; - } } :local(.before-title) { diff --git a/src/react-components/styles/global.scss b/src/react-components/styles/global.scss index 6ae0ac8f39..1944c296af 100644 --- a/src/react-components/styles/global.scss +++ b/src/react-components/styles/global.scss @@ -69,14 +69,6 @@ html { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" } -/* - * Ensure horizontal rules are visible by default - */ - -hr { - border-top-width: 1px; -} - textarea { resize: vertical; } @@ -98,7 +90,7 @@ h4, h5, h6 { font-size: inherit; - font-weight: inherit; + font-weight: theme.$font-weight-bold; } /** @@ -232,14 +224,21 @@ body::before { h5 { font-size: theme.$font-size-sm; - font-weight: theme.$font-weight-bold; } -label, small { +label, small, strong { font-size: theme.$font-size-xs; font-weight: theme.$font-weight-bold; } +small { + color: theme.$darkgrey; +} + +p, small, strong { + line-height: 1.25; +} + a { color: theme.$blue; @@ -252,6 +251,26 @@ a { } } +hr { + position: relative; + width: 90%; + border: none; + border-bottom: 1px solid theme.$grey; + margin: 16px 0; + + &:after { + background: theme.$white; + content: attr(data-or-text); + padding: 0 4px; + position: relative; + color: theme.$black; + font-size: theme.$font-size-sm; + font-weight: theme.$font-weight-bold; + position: absolute; + transform: translateY(-50%) translateX(-50%); + } +} + input::placeholder { color: theme.$darkgrey; }