Fixed header shadow on older Safari

This commit is contained in:
squidfunk
2020-02-15 23:24:29 +01:00
parent a6b22a4461
commit a539eab0b5
2 changed files with 5 additions and 1 deletions

View File

@@ -52,7 +52,10 @@ export function watchHeader(
el: HTMLElement
): Observable<Header> {
const styles = getComputedStyle(el)
const sticky = styles.position === "sticky"
const sticky = [
"sticky", /* Modern browsers */
"-webkit-sticky" /* Old Safari */
].includes(styles.position)
return of({
sticky,
height: sticky ? el.offsetHeight : 0