feat(canvas): refine connections, text styles and icon editing
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import type { CSSProperties } from "react";
|
||||
import type { CanvasNodeData } from "@/lib/canvas-elements";
|
||||
export function textAppearance(data: CanvasNodeData): CSSProperties {
|
||||
const style = data.textStyle || {};
|
||||
return { fontSize: data.fontSize || (data.kind === "plain-text" ? 24 : 13), color: style.color || "#37352f", fontWeight: style.bold ? 700 : 400, fontStyle: style.italic ? "italic" : "normal", textDecoration: style.underline ? "underline" : "none", textAlign: style.align || "left", lineHeight: style.lineHeight || 1.5,
|
||||
fontFamily: style.fontFamily === "serif" ? 'Georgia, "Songti SC", serif' : style.fontFamily === "mono" ? 'ui-monospace, "SFMono-Regular", monospace' : "inherit", backgroundColor: style.background || "transparent" };
|
||||
}
|
||||
Reference in New Issue
Block a user