diff --git a/app/components/DocumentCard.tsx b/app/components/DocumentCard.tsx index 1355fad5e..1372bcfa1 100644 --- a/app/components/DocumentCard.tsx +++ b/app/components/DocumentCard.tsx @@ -279,8 +279,8 @@ const Heading = styled.h3` overflow: hidden; color: ${s("text")}; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, - Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; + font-family: ${s("fontFamily")}; + font-weight: 500; `; export default observer(DocumentCard); diff --git a/app/components/DocumentListItem.tsx b/app/components/DocumentListItem.tsx index e28da902e..009085a95 100644 --- a/app/components/DocumentListItem.tsx +++ b/app/components/DocumentListItem.tsx @@ -262,8 +262,8 @@ const Heading = styled.h3<{ rtl?: boolean }>` margin-bottom: 0.25em; white-space: nowrap; color: ${s("text")}; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, - Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; + font-family: ${s("fontFamily")}; + font-weight: 500; `; const StarPositioner = styled(Flex)` diff --git a/app/components/FilterOptions.tsx b/app/components/FilterOptions.tsx index db89d7b1f..be39e4150 100644 --- a/app/components/FilterOptions.tsx +++ b/app/components/FilterOptions.tsx @@ -80,7 +80,7 @@ const Note = styled(Text)` margin-bottom: 0; line-height: 1.2em; font-size: 14px; - font-weight: 400; + font-weight: 500; color: ${s("textTertiary")}; `; diff --git a/app/components/Modal.tsx b/app/components/Modal.tsx index 55f7dd36f..5cab19eab 100644 --- a/app/components/Modal.tsx +++ b/app/components/Modal.tsx @@ -94,11 +94,9 @@ const Modal: React.FC = ({ {title} )} - - - - - + + + diff --git a/app/components/Text.ts b/app/components/Text.ts index f9759745d..aa90a1da8 100644 --- a/app/components/Text.ts +++ b/app/components/Text.ts @@ -1,4 +1,4 @@ -import styled from "styled-components"; +import styled, { css } from "styled-components"; type Props = { type?: "secondary" | "tertiary" | "danger"; @@ -31,12 +31,17 @@ const Text = styled.p` : props.size === "xsmall" ? "13px" : "inherit"}; - font-weight: ${(props) => - props.weight === "bold" - ? 500 - : props.weight === "normal" - ? "normal" - : "inherit"}; + + ${(props) => + props.weight && + css` + font-weight: ${props.weight === "bold" + ? 500 + : props.weight === "normal" + ? 400 + : "inherit"}; + `} + white-space: normal; user-select: ${(props) => (props.selectable ? "text" : "none")}; `; diff --git a/app/scenes/Document/components/ReferenceListItem.tsx b/app/scenes/Document/components/ReferenceListItem.tsx index 9aa087b7d..a5f571fbe 100644 --- a/app/scenes/Document/components/ReferenceListItem.tsx +++ b/app/scenes/Document/components/ReferenceListItem.tsx @@ -49,8 +49,7 @@ const Title = styled.div` line-height: 1.25; padding-top: 3px; color: ${s("text")}; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, - Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; + font-family: ${s("fontFamily")}; `; function ReferenceListItem({ diff --git a/app/scenes/Search/Search.tsx b/app/scenes/Search/Search.tsx index 74965370e..9b76f7b27 100644 --- a/app/scenes/Search/Search.tsx +++ b/app/scenes/Search/Search.tsx @@ -464,7 +464,7 @@ const SearchTitlesFilter = styled(Switch)` margin-left: 8px; margin-top: 2px; font-size: 14px; - font-weight: 500; + font-weight: 400; `; export default withTranslation()(withStores(withRouter(Search))); diff --git a/app/typings/styled-components.d.ts b/app/typings/styled-components.d.ts index 2d29ecc66..f30b74449 100644 --- a/app/typings/styled-components.d.ts +++ b/app/typings/styled-components.d.ts @@ -20,7 +20,9 @@ declare module "styled-components" { scrollbarThumb: string; fontFamily: string; fontFamilyMono: string; - fontWeight: number; + fontWeightRegular: number; + fontWeightMedium: number; + fontWeightBold: number; link: string; placeholder: string; textSecondary: string; diff --git a/public/fonts/Inter-italic.var.woff2 b/public/fonts/Inter-italic.var.woff2 new file mode 100644 index 000000000..b826d5af8 Binary files /dev/null and b/public/fonts/Inter-italic.var.woff2 differ diff --git a/public/fonts/Inter.var.woff2 b/public/fonts/Inter.var.woff2 new file mode 100644 index 000000000..365eedc50 Binary files /dev/null and b/public/fonts/Inter.var.woff2 differ diff --git a/server/routes/index.ts b/server/routes/index.ts index f2694bf0f..f4fbdf63c 100644 --- a/server/routes/index.ts +++ b/server/routes/index.ts @@ -23,7 +23,7 @@ const router = new Router(); koa.use(userAgent); // serve public assets -router.use(["/images/*", "/email/*"], async (ctx, next) => { +router.use(["/images/*", "/email/*", "/fonts/*"], async (ctx, next) => { let done; if (ctx.method === "HEAD" || ctx.method === "GET") { diff --git a/server/static/index.html b/server/static/index.html index 7da726054..969849590 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -30,6 +30,21 @@ title="Outline" />