mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 10:00:52 +01:00
Fixed header shadow on older Safari
This commit is contained in:
parent
a6b22a4461
commit
a539eab0b5
@ -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
|
||||
|
@ -66,6 +66,7 @@ body {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
// Hack: reset font-size to 10px, so the spacing for all inline elements is
|
||||
// correct again. Otherwise the spacing would be based on 20px.
|
||||
|
Loading…
Reference in New Issue
Block a user