minimize inline style usage
This commit is contained in:
@@ -37,8 +37,8 @@
|
||||
zoomable = true,
|
||||
inversePan,
|
||||
zoomStep,
|
||||
style = '',
|
||||
class: className
|
||||
class: className,
|
||||
...rest
|
||||
}: MiniMapProps = $props();
|
||||
|
||||
let store = useStore();
|
||||
@@ -83,9 +83,10 @@
|
||||
|
||||
<Panel
|
||||
{position}
|
||||
style={style + (bgColor ? `;--xy-minimap-background-color-props:${bgColor}` : '')}
|
||||
class={['svelte-flow__minimap', className]}
|
||||
data-testid="svelte-flow__minimap"
|
||||
--xy-minimap-background-color-props={bgColor}
|
||||
{...rest}
|
||||
>
|
||||
{#if store.panZoom}
|
||||
<svg
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
ry={borderRadius}
|
||||
{width}
|
||||
{height}
|
||||
style={`${color ? `fill: ${color};` : ''}${strokeColor ? `stroke: ${strokeColor};` : ''}${
|
||||
strokeWidth ? `stroke-width: ${strokeWidth};` : ''
|
||||
}`}
|
||||
style:fill={color}
|
||||
style:stroke={strokeColor}
|
||||
style:stroke-width={strokeWidth}
|
||||
shape-rendering={shapeRendering}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PanelPosition } from '@xyflow/system';
|
||||
import type { ClassValue } from 'svelte/elements';
|
||||
import type { ClassValue, HTMLAttributes } from 'svelte/elements';
|
||||
import type { Node } from '$lib/types';
|
||||
|
||||
export type GetMiniMapNodeAttribute = (node: Node) => string;
|
||||
@@ -46,4 +46,4 @@ export type MiniMapProps = {
|
||||
inversePan?: boolean;
|
||||
/** Step size for zooming in/out */
|
||||
zoomStep?: number;
|
||||
};
|
||||
} & HTMLAttributes<HTMLDivElement>;
|
||||
|
||||
Reference in New Issue
Block a user