mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 15:10:57 -05:00
Rename occurrences of monoscape to monospace.
This commit is contained in:
parent
6cf18b1b9b
commit
6d5fb0a8a3
8 changed files with 36 additions and 34 deletions
|
@ -35,7 +35,7 @@ const PermissionTooltipBase = styled.div`
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: var(--monoscape-font);
|
font-family: var(--monospace-font);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-auto-flow: row dense;
|
grid-auto-flow: row dense;
|
||||||
grid-auto-columns: min(100%, var(--attachment-max-width));
|
grid-auto-columns: min(100%, var(--attachment-max-width));
|
||||||
|
|
||||||
margin: .125rem 0 .125rem;
|
margin: 0.125rem 0 0.125rem;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
||||||
&[data-spoiler="true"] {
|
&[data-spoiler="true"] {
|
||||||
filter: blur(30px);
|
filter: blur(30px);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -50,18 +50,18 @@
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
background: var(--secondary-header);
|
background: var(--secondary-header);
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre code {
|
pre code {
|
||||||
font-family: var(--monoscape-font), sans-serif;
|
font-family: var(--monospace-font), sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-loading="true"] {
|
&[data-loading="true"] {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.container, .attachment, .image {
|
.container,
|
||||||
|
.attachment,
|
||||||
|
.image {
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
vertical-align: -.3em;
|
vertical-align: -0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
p,
|
p,
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
background: var(--block);
|
background: var(--block);
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
font-family: var(--monoscape-font), monospace;
|
font-family: var(--monospace-font), monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="checkbox"] {
|
input[type="checkbox"] {
|
||||||
|
@ -133,12 +133,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.code) {
|
:global(.code) {
|
||||||
font-family: var(--monoscape-font), monospace;
|
font-family: var(--monospace-font), monospace;
|
||||||
|
|
||||||
:global(.lang) {
|
:global(.lang) {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
color: #111;
|
color: #111;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
input[type="checkbox"] + label:before {
|
input[type="checkbox"] + label:before {
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
content: 'a';
|
content: "a";
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
line-height: 12px;
|
line-height: 12px;
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="checkbox"][checked="true"] + label:before {
|
input[type="checkbox"][checked="true"] + label:before {
|
||||||
content: '✓';
|
content: "✓";
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
@ -48,7 +48,7 @@ export default styled.textarea<TextAreaProps>`
|
||||||
${(props) =>
|
${(props) =>
|
||||||
props.code
|
props.code
|
||||||
? css`
|
? css`
|
||||||
font-family: var(--monoscape-font), monospace;
|
font-family: var(--monospace-font), monospace;
|
||||||
`
|
`
|
||||||
: css`
|
: css`
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
|
|
|
@ -57,7 +57,7 @@ export type Fonts =
|
||||||
| "Raleway"
|
| "Raleway"
|
||||||
| "Ubuntu"
|
| "Ubuntu"
|
||||||
| "Comic Neue";
|
| "Comic Neue";
|
||||||
export type MonoscapeFonts =
|
export type MonospaceFonts =
|
||||||
| "Fira Code"
|
| "Fira Code"
|
||||||
| "Roboto Mono"
|
| "Roboto Mono"
|
||||||
| "Source Code Pro"
|
| "Source Code Pro"
|
||||||
|
@ -70,7 +70,7 @@ export type Theme = {
|
||||||
light?: boolean;
|
light?: boolean;
|
||||||
font?: Fonts;
|
font?: Fonts;
|
||||||
css?: string;
|
css?: string;
|
||||||
monoscapeFont?: MonoscapeFonts;
|
monospaceFont?: MonospaceFonts;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ThemeOptions {
|
export interface ThemeOptions {
|
||||||
|
@ -190,8 +190,8 @@ export const FONTS: Record<Fonts, { name: string; load: () => void }> = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MONOSCAPE_FONTS: Record<
|
export const MONOSPACE_FONTS: Record<
|
||||||
MonoscapeFonts,
|
MonospaceFonts,
|
||||||
{ name: string; load: () => void }
|
{ name: string; load: () => void }
|
||||||
> = {
|
> = {
|
||||||
"Fira Code": {
|
"Fira Code": {
|
||||||
|
@ -217,7 +217,7 @@ export const MONOSCAPE_FONTS: Record<
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FONT_KEYS = Object.keys(FONTS).sort();
|
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_FONT = "Open Sans";
|
||||||
export const DEFAULT_MONO_FONT = "Fira Code";
|
export const DEFAULT_MONO_FONT = "Fira Code";
|
||||||
|
@ -314,10 +314,10 @@ function Theme({ children, options }: Props) {
|
||||||
}, [theme.font]);
|
}, [theme.font]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const font = theme.monoscapeFont ?? DEFAULT_MONO_FONT;
|
const font = theme.monospaceFont ?? DEFAULT_MONO_FONT;
|
||||||
root.setProperty("--monoscape-font", `"${font}"`);
|
root.setProperty("--monospace-font", `"${font}"`);
|
||||||
MONOSCAPE_FONTS[font].load();
|
MONOSPACE_FONTS[font].load();
|
||||||
}, [theme.monoscapeFont]);
|
}, [theme.monospaceFont]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
root.setProperty("--ligatures", options?.ligatures ? "normal" : "none");
|
root.setProperty("--ligatures", options?.ligatures ? "normal" : "none");
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
user-select: all;
|
user-select: all;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: var(--monoscape-font);
|
font-family: var(--monospace-font);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
margin: 1rem 12px 0;
|
margin: 1rem 12px 0;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: var(--secondary-foreground);
|
color: var(--secondary-foreground);
|
||||||
font-family: var(--monoscape-font), monospace;
|
font-family: var(--monospace-font), monospace;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
|
@ -19,8 +19,8 @@ import {
|
||||||
DEFAULT_MONO_FONT,
|
DEFAULT_MONO_FONT,
|
||||||
FONTS,
|
FONTS,
|
||||||
FONT_KEYS,
|
FONT_KEYS,
|
||||||
MONOSCAPE_FONTS,
|
MONOSPACE_FONTS,
|
||||||
MONOSCAPE_FONT_KEYS,
|
MONOSPACE_FONT_KEYS,
|
||||||
Theme,
|
Theme,
|
||||||
ThemeContext,
|
ThemeContext,
|
||||||
ThemeOptions,
|
ThemeOptions,
|
||||||
|
@ -403,17 +403,17 @@ export function Component(props: Props) {
|
||||||
<Text id="app.settings.pages.appearance.mono_font" />
|
<Text id="app.settings.pages.appearance.mono_font" />
|
||||||
</h3>
|
</h3>
|
||||||
<ComboBox
|
<ComboBox
|
||||||
value={theme.monoscapeFont ?? DEFAULT_MONO_FONT}
|
value={theme.monospaceFont ?? DEFAULT_MONO_FONT}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
pushOverride({
|
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}>
|
<option value={key}>
|
||||||
{
|
{
|
||||||
MONOSCAPE_FONTS[
|
MONOSPACE_FONTS[
|
||||||
key as keyof typeof MONOSCAPE_FONTS
|
key as keyof typeof MONOSPACE_FONTS
|
||||||
].name
|
].name
|
||||||
}
|
}
|
||||||
</option>
|
</option>
|
||||||
|
|
Loading…
Reference in a new issue