From 06833bcac9179a66ea88ed971add3cc7952217a9 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 18 Apr 2023 00:30:40 +0500 Subject: [PATCH] editor: make sure editor font settings apply to all nodes --- apps/web/public/index.html | 5 ----- .../editor/src/extensions/task-item/component.tsx | 11 +++++------ .../editor/src/extensions/task-list/component.tsx | 9 +++++---- packages/editor/src/toolbar/components/icon.tsx | 8 +++++--- packages/editor/src/toolbar/tools/font.tsx | 2 +- packages/editor/styles/styles.css | 2 +- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/apps/web/public/index.html b/apps/web/public/index.html index d89b9f095..fe48f6a90 100644 --- a/apps/web/public/index.html +++ b/apps/web/public/index.html @@ -138,11 +138,6 @@ overflow: hidden; } - * { - font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", - Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - } - @keyframes fadeUp { 0% { transform: translateY(500px); diff --git a/packages/editor/src/extensions/task-item/component.tsx b/packages/editor/src/extensions/task-item/component.tsx index 04e316b57..4fd78c8ef 100644 --- a/packages/editor/src/extensions/task-item/component.tsx +++ b/packages/editor/src/extensions/task-item/component.tsx @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -import { Flex, Text } from "@theme-ui/components"; +import { Box, Flex } from "@theme-ui/components"; import { ReactNodeViewProps } from "../react"; import { Icon } from "../../toolbar/components/icon"; import { Icons } from "../../toolbar/icons"; @@ -106,7 +106,6 @@ export function TaskItemComponent( borderRadius: "default", alignSelf: "start", p: "1px", - mt: "2px", mr: 1, cursor: editor.isEditable ? "pointer" : "unset", ":hover": { @@ -114,7 +113,8 @@ export function TaskItemComponent( }, ":hover .icon path": { fill: "var(--checked) !important" - } + }, + fontFamily: "inherit" }} onMouseDown={(e) => { if (globalThis["keyboardShown"]) { @@ -129,11 +129,10 @@ export function TaskItemComponent( } }} color={checked ? "checked" : "icon"} - size={isMobile ? 16 : 14} + size={isMobile ? "1.66ch" : "1.46ch"} /> - .taskitem-content-wrapper > p": { diff --git a/packages/editor/src/extensions/task-list/component.tsx b/packages/editor/src/extensions/task-list/component.tsx index 05bc45174..5e1667af3 100644 --- a/packages/editor/src/extensions/task-list/component.tsx +++ b/packages/editor/src/extensions/task-list/component.tsx @@ -108,7 +108,8 @@ export function TaskListComponent( px: 2, zIndex: 1, color: "fontTertiary", - fontSize: "title" + fontSize: "inherit", + fontFamily: "inherit" }} placeholder="Untitled" onChange={(e) => { @@ -168,15 +169,15 @@ export function TaskListComponent( mr: 2, color: "fontTertiary", flexShrink: 0, - zIndex: 1 + zIndex: 1, + fontFamily: "inherit" }} > {stats.checked}/{stats.total} )} - ); } diff --git a/packages/editor/styles/styles.css b/packages/editor/styles/styles.css index c69292a2f..05e2a2264 100644 --- a/packages/editor/styles/styles.css +++ b/packages/editor/styles/styles.css @@ -509,7 +509,7 @@ p > *::selection { .outline-list li > p::before { position: absolute; - top: 4px; + top: 15%; cursor: pointer; content: ""; background-size: 18px;