Rename occurrences of monoscape to monospace.

This commit is contained in:
Paul 2021-07-25 14:26:45 +01:00
parent 6cf18b1b9b
commit 6d5fb0a8a3
8 changed files with 36 additions and 34 deletions

View file

@ -35,7 +35,7 @@ const PermissionTooltipBase = styled.div`
}
code {
font-family: var(--monoscape-font);
font-family: var(--monospace-font);
}
`;

View file

@ -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);
}

View file

@ -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;

View file

@ -48,7 +48,7 @@ export default styled.textarea<TextAreaProps>`
${(props) =>
props.code
? css`
font-family: var(--monoscape-font), monospace;
font-family: var(--monospace-font), monospace;
`
: css`
font-family: inherit;

View file

@ -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<Fonts, { name: string; load: () => 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");

View file

@ -7,7 +7,7 @@
user-select: all;
font-size: 1.4em;
text-align: center;
font-family: var(--monoscape-font);
font-family: var(--monospace-font);
}
}

View file

@ -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;

View file

@ -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) {
<Text id="app.settings.pages.appearance.mono_font" />
</h3>
<ComboBox
value={theme.monoscapeFont ?? DEFAULT_MONO_FONT}
value={theme.monospaceFont ?? DEFAULT_MONO_FONT}
onChange={(e) =>
pushOverride({
monoscapeFont: e.currentTarget.value as any,
monospaceFont: e.currentTarget.value as any,
})
}>
{MONOSCAPE_FONT_KEYS.map((key) => (
{MONOSPACE_FONT_KEYS.map((key) => (
<option value={key}>
{
MONOSCAPE_FONTS[
key as keyof typeof MONOSCAPE_FONTS
MONOSPACE_FONTS[
key as keyof typeof MONOSPACE_FONTS
].name
}
</option>