From 464c9a68080bc1b436fe45f7dd74099d6c2a046e Mon Sep 17 00:00:00 2001 From: streamich Date: Sun, 10 Nov 2024 16:11:10 +0100 Subject: [PATCH] =?UTF-8?q?fix(json-crdt-peritext-ui):=20=F0=9F=90=9B=20fi?= =?UTF-8?q?xup=20caret=20rendering=20for=20spacious=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/json-crdt-peritext-ui/plugins/debug/RenderBlock.tsx | 1 + .../plugins/minimal/Chrome/index.tsx | 1 + src/json-crdt-peritext-ui/plugins/minimal/RenderCaret.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/json-crdt-peritext-ui/plugins/debug/RenderBlock.tsx b/src/json-crdt-peritext-ui/plugins/debug/RenderBlock.tsx index 6a03eeff67..afb1eed181 100644 --- a/src/json-crdt-peritext-ui/plugins/debug/RenderBlock.tsx +++ b/src/json-crdt-peritext-ui/plugins/debug/RenderBlock.tsx @@ -36,6 +36,7 @@ export const RenderBlock: React.FC = ({block, hash, children}) padding: '2px 4px', borderRadius: 3, background: 'rgba(0,0,0)', + lineHeight: '1.2em', color: 'white', display: 'inline-block', }} diff --git a/src/json-crdt-peritext-ui/plugins/minimal/Chrome/index.tsx b/src/json-crdt-peritext-ui/plugins/minimal/Chrome/index.tsx index 495ba0cfe7..3a0dd39e09 100644 --- a/src/json-crdt-peritext-ui/plugins/minimal/Chrome/index.tsx +++ b/src/json-crdt-peritext-ui/plugins/minimal/Chrome/index.tsx @@ -9,6 +9,7 @@ const blockClass = rule({ bxz: 'border-box', bdrad: '16px', pad: '24px 32px', + lh: '1.8em', bxsh: '0 1px 8px #00000008,0 1px 4px #0000000a,0 4px 10px #0000000f', '&:hover': { bxsh: '0 1px 8px #00000008,0 1px 4px #0000000a,0 4px 10px #0000000f,0 0 3px #0000001f', diff --git a/src/json-crdt-peritext-ui/plugins/minimal/RenderCaret.tsx b/src/json-crdt-peritext-ui/plugins/minimal/RenderCaret.tsx index 094e50fa1b..aacb23c783 100644 --- a/src/json-crdt-peritext-ui/plugins/minimal/RenderCaret.tsx +++ b/src/json-crdt-peritext-ui/plugins/minimal/RenderCaret.tsx @@ -26,16 +26,18 @@ const blockClass = rule({ w: '0px', h: '100%', bg: 'black', - va: 'top', + va: 'center', }); const innerClass = rule({ pos: 'absolute', - top: '-0.25em', - left: '-0.0625em', + d: 'inline-block', + b: '-0.4em', + l: '-0.065em', w: '.2em', h: '1.5em', bg: DefaultRendererColors.ActiveCursor, + bdl: `1px dotted ${DefaultRendererColors.InactiveCursor}`, bdrad: '0.0625em', 'mix-blend-mode': 'multiply', an: moveAnimation + ' .25s ease-out',