Use "Inter" as default typeface (#5741)

* Inter

* tweaks

* tweaks
This commit is contained in:
Tom Moor
2023-08-31 18:07:45 -04:00
committed by GitHub
parent 7abb4f9ad6
commit 4e53029377
15 changed files with 60 additions and 44 deletions

View File

@@ -279,8 +279,8 @@ const Heading = styled.h3`
overflow: hidden; overflow: hidden;
color: ${s("text")}; color: ${s("text")};
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, font-family: ${s("fontFamily")};
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; font-weight: 500;
`; `;
export default observer(DocumentCard); export default observer(DocumentCard);

View File

@@ -262,8 +262,8 @@ const Heading = styled.h3<{ rtl?: boolean }>`
margin-bottom: 0.25em; margin-bottom: 0.25em;
white-space: nowrap; white-space: nowrap;
color: ${s("text")}; color: ${s("text")};
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, font-family: ${s("fontFamily")};
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; font-weight: 500;
`; `;
const StarPositioner = styled(Flex)` const StarPositioner = styled(Flex)`

View File

@@ -80,7 +80,7 @@ const Note = styled(Text)`
margin-bottom: 0; margin-bottom: 0;
line-height: 1.2em; line-height: 1.2em;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 500;
color: ${s("textTertiary")}; color: ${s("textTertiary")};
`; `;

View File

@@ -94,11 +94,9 @@ const Modal: React.FC<Props> = ({
{title} {title}
</Text> </Text>
)} )}
<Text as="span" size="large"> <NudeButton onClick={onRequestClose}>
<NudeButton onClick={onRequestClose}> <CloseIcon />
<CloseIcon /> </NudeButton>
</NudeButton>
</Text>
</Header> </Header>
</Centered> </Centered>
</Small> </Small>

View File

@@ -1,4 +1,4 @@
import styled from "styled-components"; import styled, { css } from "styled-components";
type Props = { type Props = {
type?: "secondary" | "tertiary" | "danger"; type?: "secondary" | "tertiary" | "danger";
@@ -31,12 +31,17 @@ const Text = styled.p<Props>`
: props.size === "xsmall" : props.size === "xsmall"
? "13px" ? "13px"
: "inherit"}; : "inherit"};
font-weight: ${(props) =>
props.weight === "bold" ${(props) =>
? 500 props.weight &&
: props.weight === "normal" css`
? "normal" font-weight: ${props.weight === "bold"
: "inherit"}; ? 500
: props.weight === "normal"
? 400
: "inherit"};
`}
white-space: normal; white-space: normal;
user-select: ${(props) => (props.selectable ? "text" : "none")}; user-select: ${(props) => (props.selectable ? "text" : "none")};
`; `;

View File

@@ -49,8 +49,7 @@ const Title = styled.div`
line-height: 1.25; line-height: 1.25;
padding-top: 3px; padding-top: 3px;
color: ${s("text")}; color: ${s("text")};
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, font-family: ${s("fontFamily")};
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
`; `;
function ReferenceListItem({ function ReferenceListItem({

View File

@@ -464,7 +464,7 @@ const SearchTitlesFilter = styled(Switch)`
margin-left: 8px; margin-left: 8px;
margin-top: 2px; margin-top: 2px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 400;
`; `;
export default withTranslation()(withStores(withRouter(Search))); export default withTranslation()(withStores(withRouter(Search)));

View File

@@ -20,7 +20,9 @@ declare module "styled-components" {
scrollbarThumb: string; scrollbarThumb: string;
fontFamily: string; fontFamily: string;
fontFamilyMono: string; fontFamilyMono: string;
fontWeight: number; fontWeightRegular: number;
fontWeightMedium: number;
fontWeightBold: number;
link: string; link: string;
placeholder: string; placeholder: string;
textSecondary: string; textSecondary: string;

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ const router = new Router();
koa.use<BaseContext, UserAgentContext>(userAgent); koa.use<BaseContext, UserAgentContext>(userAgent);
// serve public assets // serve public assets
router.use(["/images/*", "/email/*"], async (ctx, next) => { router.use(["/images/*", "/email/*", "/fonts/*"], async (ctx, next) => {
let done; let done;
if (ctx.method === "HEAD" || ctx.method === "GET") { if (ctx.method === "HEAD" || ctx.method === "GET") {

View File

@@ -30,6 +30,21 @@
title="Outline" title="Outline"
/> />
<style> <style>
@font-face {
font-family: "Inter";
font-display: swap;
font-feature-settings: "ss03", "cv05";
src: url("{cdn-url}/fonts/Inter.var.woff2") format("woff2");
}
@font-face {
font-family: "Inter";
font-display: swap;
font-feature-settings: "ss03", "cv05";
font-style: italic;
src: url("{cdn-url}/fonts/Inter-italic.var.woff2") format("woff2");
}
body, body,
html { html {
margin: 0; margin: 0;

View File

@@ -254,9 +254,9 @@ flex-grow: ${props.grow ? 1 : 0};
justify-content: start; justify-content: start;
color: ${props.theme.text}; color: ${props.theme.text};
font-family: ${props.theme.fontFamily}; font-family: ${props.theme.fontFamily};
font-weight: ${props.theme.fontWeight}; font-weight: ${props.theme.fontWeightRegular};
font-size: 1em; font-size: 1em;
line-height: 1.6em; line-height: -0.011;
width: 100%; width: 100%;
.mention { .mention {
@@ -285,9 +285,6 @@ width: 100%;
word-wrap: break-word; word-wrap: break-word;
white-space: pre-wrap; white-space: pre-wrap;
white-space: break-spaces; white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
padding: ${props.editorStyle?.padding ?? "initial"}; padding: ${props.editorStyle?.padding ?? "initial"};
margin: ${props.editorStyle?.margin ?? "initial"}; margin: ${props.editorStyle?.margin ?? "initial"};
@@ -329,12 +326,12 @@ width: 100%;
// all of heading sizes are stepped down one from global styles, except h1 // all of heading sizes are stepped down one from global styles, except h1
// which is between h1 and h2 // which is between h1 and h2
h1 { font-size: 1.75em; } h1 { font-size: 28px; }
h2 { font-size: 1.25em; } h2 { font-size: 22px; }
h3 { font-size: 1em; } h3 { font-size: 18px; }
h4 { font-size: 0.875em; } h4 { font-size: 16px; }
h5 { font-size: 0.75em; } h5 { font-size: 15px; }
h6 { font-size: 0.75em; } h6 { font-size: 15px; }
.ProseMirror-yjs-cursor { .ProseMirror-yjs-cursor {
position: relative; position: relative;

View File

@@ -30,8 +30,7 @@ export default createGlobalStyle<Props>`
optgroup, optgroup,
select, select,
textarea { textarea {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, font-family: ${s("fontFamily")};
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
} }
body { body {
@@ -82,12 +81,11 @@ export default createGlobalStyle<Props>`
margin-top: 1em; margin-top: 1em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
h1 { font-size: 2.25em; } h1 { font-size: 36px; }
h2 { font-size: 1.5em; } h2 { font-size: 26px; }
h3 { font-size: 1.25em; } h3 { font-size: 22px; }
h4 { font-size: 1em; } h4 { font-size: 18px; }
h5 { font-size: 0.875em; } h5 { font-size: 16px; }
h6 { font-size: 0.75em; }
p, p,
dl, dl,

View File

@@ -59,10 +59,12 @@ const buildBaseTheme = (input: Partial<Colors>) => {
return { return {
fontFamily: fontFamily:
"-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen, Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif", "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif",
fontFamilyMono: fontFamilyMono:
"'SFMono-Regular',Consolas,'Liberation Mono', Menlo, Courier,monospace", "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",
fontWeight: 400, fontWeightRegular: 400,
fontWeightMedium: 500,
fontWeightBold: 600,
backgroundTransition: "background 100ms ease-in-out", backgroundTransition: "background 100ms ease-in-out",
accentText: colors.white, accentText: colors.white,
selected: colors.accent, selected: colors.accent,