Skip to content

Commit

Permalink
fix: strange position: relative inline style issue, resolve with unse…
Browse files Browse the repository at this point in the history
…tting
  • Loading branch information
smukkejohan committed Mar 21, 2024
1 parent bef32b9 commit 7b090b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/components/Sequence.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
on:pointermove={handlePointerMove}
class={uniqueClasses(`${containerClasses}${className ? ` ${className}` : ''}`)}
style={background}
style:position="unset"
{...$$restProps}
>
<slot {currentTime} layers={$sequenceData.layers}>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/utils/cssBackgroundGuides.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// 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,
{ lineWidth = 0.5, color = '#9993' }
) => {
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%;`;
};

0 comments on commit 7b090b3

Please sign in to comment.