Update rich editor style to be lighter and closer to printed doc

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-03 16:40:35 +04:00
parent 6d1a7c846d
commit 5359fe9931
13 changed files with 118 additions and 84 deletions

View File

@@ -19,7 +19,7 @@ type BlockMenuTriggerProps = {
};
export function BlockMenuTrigger({ editor, hoveredBlock }: BlockMenuTriggerProps) {
const { triggerRefs, triggerStyles, isPositioned } = useBlockTrigger(hoveredBlock, 40);
const { triggerRefs, triggerStyles, isPositioned } = useBlockTrigger(hoveredBlock, 32);
const handleTriggerClick = () => {
try {
@@ -81,7 +81,7 @@ export function BlockMenuTrigger({ editor, hoveredBlock }: BlockMenuTriggerProps
}}
className={trigger()}
>
<PlusIcon size={16} weight="bold" />
<PlusIcon size={14} weight="bold" />
</button>
);
}

View File

@@ -7,7 +7,7 @@ import { tv } from "tailwind-variants";
export const blockMenuVariants = tv({
slots: {
trigger: [
"z-20 flex size-6 items-center justify-center",
"z-20 flex size-5 items-center justify-center",
"rounded text-txt-tertiary hover:bg-subtle hover:text-txt-primary text-xl font-light cursor-pointer",
],
menu: ["rounded-lg border border-border-mid bg-level-0 p-1 shadow-mid z-30"],

View File

@@ -37,7 +37,7 @@ export function OptionsMenuTrigger({
menuRefs,
getReferenceProps,
}: OptionsMenuTriggerProps) {
const { triggerRefs, triggerStyles, isPositioned } = useBlockTrigger(hoveredBlock, 16);
const { triggerRefs, triggerStyles, isPositioned } = useBlockTrigger(hoveredBlock, 12);
const onDragStart = (e: DragEvent<HTMLButtonElement>) => {
if (!hoveredBlock) return;
@@ -91,7 +91,7 @@ export function OptionsMenuTrigger({
}}
className={trigger()}
>
<DotsSixVerticalIcon size={20} weight="bold" />
<DotsSixVerticalIcon size={16} weight="bold" />
</button>
);
}

View File

@@ -7,7 +7,7 @@ import { tv } from "tailwind-variants";
export const optionsMenuVariants = tv({
slots: {
trigger: [
"z-20 flex size-6 items-center justify-center",
"z-20 flex size-5 items-center justify-center",
"rounded text-txt-tertiary hover:bg-subtle hover:text-txt-primary cursor-grab",
],
menu: ["rounded-lg border border-border-mid bg-level-0 p-1 shadow-mid z-30"],

View File

@@ -67,10 +67,10 @@ const extensions = [
];
const richEditorVariants = tv({
base: ["relative flex-1 pb-14"],
base: ["relative flex-1 py-14 pr-8 bg-level-1 shadow-base"],
variants: {
disabled: {
true: "",
true: "pl-8",
false: "pl-14",
},
},
@@ -83,7 +83,7 @@ type RichEditorProps = ComponentProps<"div"> & {
};
export function RichEditor(props: RichEditorProps) {
const { className, content, disabled = false, onChangeContent } = props;
const { className, content, disabled = false, onChangeContent, ...divProps } = props;
const handleUpdate = useCallback(
({ editor }: { editor: Editor }) => {
@@ -112,7 +112,7 @@ export function RichEditor(props: RichEditorProps) {
if (!editor) return null;
return (
<div className={richEditorVariants({ className, disabled })}>
<div className={richEditorVariants({ className, disabled })} {...divProps}>
{!disabled
&& (
<>

View File

@@ -145,7 +145,7 @@ export function TableColumnMenuTrigger({
strategy: "fixed",
placement: "top",
middleware: [
offset(6),
offset(4),
size({
apply({ rects, elements }) {
Object.assign(elements.floating.style, {

View File

@@ -9,7 +9,7 @@ export const tableColumnMenuVariants = tv({
trigger: [
"z-20 flex items-center justify-center",
"rounded text-txt-tertiary bg-subtle hover:bg-border-solid cursor-grab",
"py-0.5 h-3",
"py-0.5 h-2",
],
menu: ["rounded-lg border border-border-mid bg-level-0 p-1 shadow-mid z-30"],
},

View File

@@ -145,7 +145,7 @@ export function TableRowMenuTrigger({
strategy: "fixed",
placement: "left",
middleware: [
offset(6),
offset(4),
size({
apply({ rects, elements }) {
Object.assign(elements.floating.style, {

View File

@@ -9,7 +9,7 @@ export const tableRowMenuVariants = tv({
trigger: [
"z-20 flex flex-col items-center justify-center",
"rounded text-txt-tertiary bg-subtle hover:bg-border-solid cursor-grab",
"px-0.5 w-3",
"px-0.5 w-2",
],
menu: ["rounded-lg border border-border-mid bg-level-0 p-1 shadow-mid z-30"],
},