-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: strange position: relative inline style issue, resolve with unse…
…tting
- Loading branch information
1 parent
bef32b9
commit 7b090b3
Showing
2 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%;`; | ||
}; |