From dcf607f279b4d98868c3f13c6fcd8c2daf50abf3 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 18 Oct 2022 14:26:28 +0200 Subject: [PATCH] fix(core): allow undefined as custom theme var value --- packages/core/src/types/flow.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/types/flow.ts b/packages/core/src/types/flow.ts index b7938b11..9e783bfc 100644 --- a/packages/core/src/types/flow.ts +++ b/packages/core/src/types/flow.ts @@ -39,7 +39,10 @@ export type Elements< EdgeEvents extends Record = any, > = Element[] -export type CustomThemeVars = Record +export interface CustomThemeVars { + [key: string]: string | number | undefined +} + export type CSSVars = | '--vf-node-color' | '--vf-box-shadow' @@ -47,6 +50,7 @@ export type CSSVars = | '--vf-node-text' | '--vf-connection-path' | '--vf-handle' + export type ThemeVars = { [key in CSSVars]?: CSSProperties['color'] } export type Styles = CSSProperties & ThemeVars & CustomThemeVars export type ClassFunc = (element: ElementType) => string | void