From 7b090b353692ebbd7cb43a67fcfc14740d4e7d02 Mon Sep 17 00:00:00 2001 From: Johan Bichel Date: Thu, 21 Mar 2024 16:22:50 +0100 Subject: [PATCH] fix: strange position: relative inline style issue, resolve with unsetting --- src/lib/components/Sequence.svelte | 1 + src/lib/utils/cssBackgroundGuides.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/components/Sequence.svelte b/src/lib/components/Sequence.svelte index 907fe2b..d99d0b8 100644 --- a/src/lib/components/Sequence.svelte +++ b/src/lib/components/Sequence.svelte @@ -83,6 +83,7 @@ on:pointermove={handlePointerMove} class={uniqueClasses(`${containerClasses}${className ? ` ${className}` : ''}`)} style={background} + style:position="unset" {...$$restProps} > diff --git a/src/lib/utils/cssBackgroundGuides.ts b/src/lib/utils/cssBackgroundGuides.ts index 44c575b..662f9c5 100644 --- a/src/lib/utils/cssBackgroundGuides.ts +++ b/src/lib/utils/cssBackgroundGuides.ts @@ -1,4 +1,5 @@ // TODO: use css-var for color and change with dark mode +// FIXME: this results in an inline style containing position: relative; which breaks modals as it renders on top of them. Currently we are unsetting this again. But not surte why it happens. Definetely not an elegant fix currently. export const cssBackgroundGuides = ( duration: number, millis = 2000, @@ -6,7 +7,6 @@ export const cssBackgroundGuides = ( ) => { const divisions = duration / millis; const divisionsPercent = 100 / divisions; - return `background-image: - linear-gradient(90deg, ${color} ${lineWidth}px, transparent ${lineWidth}px, transparent calc(100% - ${lineWidth}px), ${color} calc(100% - ${lineWidth}px)); - background-size: ${divisionsPercent}% 100%;`; + return `background-image: linear-gradient(90deg, ${color} ${lineWidth}px, transparent ${lineWidth}px, transparent calc(100% - ${lineWidth}px), ${color} calc(100% - ${lineWidth}px)); + background-size: ${divisionsPercent}% 100%;`; };