mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-08-03 19:19:42 -04:00
Fixed header shadow on older Safari
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user