minimize inline style usage

This commit is contained in:
peterkogo
2025-04-15 12:57:34 +02:00
parent 2ca682c6f2
commit 1fa3b50366
18 changed files with 65 additions and 91 deletions
@@ -5,6 +5,7 @@
import drag from '$lib/actions/drag';
import type { NodeSelectionProps } from './types';
import { toPxString } from '$lib/utils';
let {
store = $bindable(),
@@ -38,7 +39,9 @@
{#if store.selectionRectMode === 'nodes' && bounds && isNumeric(bounds.x) && isNumeric(bounds.y)}
<div
class="selection-wrapper nopan"
style="width: {bounds.width}px; height: {bounds.height}px; transform: translate({bounds.x}px, {bounds.y}px)"
style:width={toPxString(bounds.width)}
style:height={toPxString(bounds.height)}
style:transform="translate({bounds.x}px, {bounds.y}px)"
use:drag={{
disabled: false,
store,