biome format --write

This commit is contained in:
Henry Jameson 2026-01-06 16:22:52 +02:00
commit 9262e803ec
415 changed files with 54076 additions and 17419 deletions

View file

@ -1,7 +1,12 @@
export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadding = true) => {
export const findOffset = (
child,
parent,
{ top = 0, left = 0 } = {},
ignorePadding = true,
) => {
const result = {
top: top + child.offsetTop,
left: left + child.offsetLeft
left: left + child.offsetLeft,
}
if (!ignorePadding && child !== window) {
const { topPadding, leftPadding } = findPadding(child)
@ -9,7 +14,13 @@ export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadd
result.left += ignorePadding ? 0 : leftPadding
}
if (child.offsetParent && window.getComputedStyle(child.offsetParent).position !== 'sticky' && (parent === window || parent.contains(child.offsetParent) || parent === child.offsetParent)) {
if (
child.offsetParent &&
window.getComputedStyle(child.offsetParent).position !== 'sticky' &&
(parent === window ||
parent.contains(child.offsetParent) ||
parent === child.offsetParent)
) {
return findOffset(child.offsetParent, parent, result, false)
} else {
if (parent !== window) {
@ -23,9 +34,13 @@ export const findOffset = (child, parent, { top = 0, left = 0 } = {}, ignorePadd
const findPadding = (el) => {
const topPaddingStr = window.getComputedStyle(el)['padding-top']
const topPadding = Number(topPaddingStr.substring(0, topPaddingStr.length - 2))
const topPadding = Number(
topPaddingStr.substring(0, topPaddingStr.length - 2),
)
const leftPaddingStr = window.getComputedStyle(el)['padding-left']
const leftPadding = Number(leftPaddingStr.substring(0, leftPaddingStr.length - 2))
const leftPadding = Number(
leftPaddingStr.substring(0, leftPaddingStr.length - 2),
)
return { topPadding, leftPadding }
}