mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-17 00:15:30 -04:00
make sticky header optional via prop
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
.header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 4.5em;
|
||||
padding: 0.7em 1.5em;
|
||||
border-bottom: 1px solid var(--kinda-light);
|
||||
background-color: var(--background-header);
|
||||
backdrop-filter: saturate(180%) blur(5px);
|
||||
z-index: 1000;
|
||||
|
||||
/* light-dark theme switch fading */
|
||||
transition: color 0.25s ease, background 0.25s ease, border 0.25s ease;
|
||||
}
|
||||
|
||||
.sticky {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
backdrop-filter: saturate(180%) blur(5px);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@@ -5,10 +5,12 @@ import Menu from "../Menu/Menu";
|
||||
|
||||
import styles from "./Header.module.css";
|
||||
|
||||
type HeaderProps = JSX.IntrinsicElements["div"];
|
||||
type HeaderProps = JSX.IntrinsicElements["header"] & {
|
||||
sticky?: boolean;
|
||||
};
|
||||
|
||||
const Header = ({ className }: HeaderProps) => (
|
||||
<header className={classNames(styles.header, className)}>
|
||||
const Header = ({ sticky, className, ...rest }: HeaderProps) => (
|
||||
<header className={classNames(styles.header, sticky && styles.sticky, className)} {...rest}>
|
||||
<nav className={styles.nav}>
|
||||
<Selfie className={styles.selfie} />
|
||||
<Menu className={styles.menu} />
|
||||
|
Reference in New Issue
Block a user