From 6d5fb0a8a37dc13301e38206ccb58511b5480b4d Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 25 Jul 2021 14:26:45 +0100 Subject: [PATCH] Rename occurrences of monoscape to monospace. --- src/components/common/Tooltip.tsx | 2 +- .../attachments/Attachment.module.scss | 18 ++++++++++-------- src/components/markdown/Markdown.module.scss | 12 ++++++------ src/components/ui/TextArea.tsx | 2 +- src/context/Theme.tsx | 18 +++++++++--------- .../intermediate/modals/Prompt.module.scss | 2 +- src/pages/settings/Settings.module.scss | 2 +- src/pages/settings/panes/Appearance.tsx | 14 +++++++------- 8 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/components/common/Tooltip.tsx b/src/components/common/Tooltip.tsx index 16225322..bd7c638f 100644 --- a/src/components/common/Tooltip.tsx +++ b/src/components/common/Tooltip.tsx @@ -35,7 +35,7 @@ const PermissionTooltipBase = styled.div` } code { - font-family: var(--monoscape-font); + font-family: var(--monospace-font); } `; diff --git a/src/components/common/messaging/attachments/Attachment.module.scss b/src/components/common/messaging/attachments/Attachment.module.scss index 1b0e862a..ce818ee1 100644 --- a/src/components/common/messaging/attachments/Attachment.module.scss +++ b/src/components/common/messaging/attachments/Attachment.module.scss @@ -2,11 +2,11 @@ display: grid; grid-auto-flow: row dense; grid-auto-columns: min(100%, var(--attachment-max-width)); - - margin: .125rem 0 .125rem; + + margin: 0.125rem 0 0.125rem; width: max-content; max-width: 100%; - + &[data-spoiler="true"] { filter: blur(30px); pointer-events: none; @@ -50,18 +50,18 @@ overflow-y: auto; border-radius: 0 !important; background: var(--secondary-header); - + pre { margin: 0; } - + pre code { - font-family: var(--monoscape-font), sans-serif; + font-family: var(--monospace-font), sans-serif; } &[data-loading="true"] { display: flex; - + > * { flex-grow: 1; } @@ -84,6 +84,8 @@ } } -.container, .attachment, .image { +.container, +.attachment, +.image { border-radius: var(--border-radius); } diff --git a/src/components/markdown/Markdown.module.scss b/src/components/markdown/Markdown.module.scss index 60056cf5..de057a56 100644 --- a/src/components/markdown/Markdown.module.scss +++ b/src/components/markdown/Markdown.module.scss @@ -12,7 +12,7 @@ margin-bottom: 0; margin-top: 1px; margin-right: 2px; - vertical-align: -.3em; + vertical-align: -0.3em; } p, @@ -86,7 +86,7 @@ font-size: 90%; background: var(--block); border-radius: var(--border-radius); - font-family: var(--monoscape-font), monospace; + font-family: var(--monospace-font), monospace; } input[type="checkbox"] { @@ -133,12 +133,12 @@ } :global(.code) { - font-family: var(--monoscape-font), monospace; + font-family: var(--monospace-font), monospace; :global(.lang) { width: fit-content; padding-bottom: 8px; - + div { color: #111; cursor: pointer; @@ -174,7 +174,7 @@ input[type="checkbox"] + label:before { width: 12px; height: 12px; - content: 'a'; + content: "a"; font-size: 10px; margin-right: 6px; line-height: 12px; @@ -185,7 +185,7 @@ } input[type="checkbox"][checked="true"] + label:before { - content: '✓'; + content: "✓"; align-items: center; display: inline-flex; justify-content: center; diff --git a/src/components/ui/TextArea.tsx b/src/components/ui/TextArea.tsx index 2469415f..01f7c371 100644 --- a/src/components/ui/TextArea.tsx +++ b/src/components/ui/TextArea.tsx @@ -48,7 +48,7 @@ export default styled.textarea` ${(props) => props.code ? css` - font-family: var(--monoscape-font), monospace; + font-family: var(--monospace-font), monospace; ` : css` font-family: inherit; diff --git a/src/context/Theme.tsx b/src/context/Theme.tsx index 11ed45cd..fcf3116e 100644 --- a/src/context/Theme.tsx +++ b/src/context/Theme.tsx @@ -57,7 +57,7 @@ export type Fonts = | "Raleway" | "Ubuntu" | "Comic Neue"; -export type MonoscapeFonts = +export type MonospaceFonts = | "Fira Code" | "Roboto Mono" | "Source Code Pro" @@ -70,7 +70,7 @@ export type Theme = { light?: boolean; font?: Fonts; css?: string; - monoscapeFont?: MonoscapeFonts; + monospaceFont?: MonospaceFonts; }; export interface ThemeOptions { @@ -190,8 +190,8 @@ export const FONTS: Record void }> = { }, }; -export const MONOSCAPE_FONTS: Record< - MonoscapeFonts, +export const MONOSPACE_FONTS: Record< + MonospaceFonts, { name: string; load: () => void } > = { "Fira Code": { @@ -217,7 +217,7 @@ export const MONOSCAPE_FONTS: Record< }; export const FONT_KEYS = Object.keys(FONTS).sort(); -export const MONOSCAPE_FONT_KEYS = Object.keys(MONOSCAPE_FONTS).sort(); +export const MONOSPACE_FONT_KEYS = Object.keys(MONOSPACE_FONTS).sort(); export const DEFAULT_FONT = "Open Sans"; export const DEFAULT_MONO_FONT = "Fira Code"; @@ -314,10 +314,10 @@ function Theme({ children, options }: Props) { }, [theme.font]); useEffect(() => { - const font = theme.monoscapeFont ?? DEFAULT_MONO_FONT; - root.setProperty("--monoscape-font", `"${font}"`); - MONOSCAPE_FONTS[font].load(); - }, [theme.monoscapeFont]); + const font = theme.monospaceFont ?? DEFAULT_MONO_FONT; + root.setProperty("--monospace-font", `"${font}"`); + MONOSPACE_FONTS[font].load(); + }, [theme.monospaceFont]); useEffect(() => { root.setProperty("--ligatures", options?.ligatures ? "normal" : "none"); diff --git a/src/context/intermediate/modals/Prompt.module.scss b/src/context/intermediate/modals/Prompt.module.scss index a228b4cc..9a930faf 100644 --- a/src/context/intermediate/modals/Prompt.module.scss +++ b/src/context/intermediate/modals/Prompt.module.scss @@ -7,7 +7,7 @@ user-select: all; font-size: 1.4em; text-align: center; - font-family: var(--monoscape-font); + font-family: var(--monospace-font); } } diff --git a/src/pages/settings/Settings.module.scss b/src/pages/settings/Settings.module.scss index 6fa0666a..97fc2d72 100644 --- a/src/pages/settings/Settings.module.scss +++ b/src/pages/settings/Settings.module.scss @@ -109,7 +109,7 @@ margin: 1rem 12px 0; font-size: 10px; color: var(--secondary-foreground); - font-family: var(--monoscape-font), monospace; + font-family: var(--monospace-font), monospace; user-select: text; display: grid; diff --git a/src/pages/settings/panes/Appearance.tsx b/src/pages/settings/panes/Appearance.tsx index 75868ee4..861075d5 100644 --- a/src/pages/settings/panes/Appearance.tsx +++ b/src/pages/settings/panes/Appearance.tsx @@ -19,8 +19,8 @@ import { DEFAULT_MONO_FONT, FONTS, FONT_KEYS, - MONOSCAPE_FONTS, - MONOSCAPE_FONT_KEYS, + MONOSPACE_FONTS, + MONOSPACE_FONT_KEYS, Theme, ThemeContext, ThemeOptions, @@ -403,17 +403,17 @@ export function Component(props: Props) { pushOverride({ - monoscapeFont: e.currentTarget.value as any, + monospaceFont: e.currentTarget.value as any, }) }> - {MONOSCAPE_FONT_KEYS.map((key) => ( + {MONOSPACE_FONT_KEYS.map((key) => (