diff --git a/client/components/header/header.module.css b/client/components/header/header.module.css index 7be42e5a..b0aee771 100644 --- a/client/components/header/header.module.css +++ b/client/components/header/header.module.css @@ -1,7 +1,7 @@ .tabs { justify-content: center; display: flex; - margin-top: var(--gap); + margin: var(--gap) 0; } .tabs .buttons { @@ -22,7 +22,7 @@ } .mobile { - position: relative; + position: absolute; z-index: 1; } diff --git a/client/components/header/index.tsx b/client/components/header/index.tsx index 3990726e..07f944d4 100644 --- a/client/components/header/index.tsx +++ b/client/components/header/index.tsx @@ -174,7 +174,7 @@ const Header = () => { const buttons = useMemo(() => pages.map(getButton), [pages, getButton]) return ( - +
{buttons} @@ -192,7 +192,8 @@ const Header = () => {
- {isMobile && expanded && (
+ {/* setExpanded should occur elsewhere; we don't want to close if they change themes */} + {isMobile && expanded && (
setExpanded(!expanded)}> diff --git a/client/components/post-page/index.tsx b/client/components/post-page/index.tsx index d0ef2171..692fb779 100644 --- a/client/components/post-page/index.tsx +++ b/client/components/post-page/index.tsx @@ -89,20 +89,8 @@ const PostPage = ({ post }: Props) => {
- - {post.title} - - - - - - - - - + } + + + {post.title} + + + + + + + +
{/* {post.files.length > 1 && } */} {post.files?.map(({ id, content, title }: File) => ( diff --git a/client/components/post-page/post-page.module.css b/client/components/post-page/post-page.module.css index af80908b..181ada40 100644 --- a/client/components/post-page/post-page.module.css +++ b/client/components/post-page/post-page.module.css @@ -3,7 +3,6 @@ flex-direction: row; justify-content: space-between; align-items: center; - margin-bottom: var(--gap); } .header .title .badges { @@ -20,6 +19,7 @@ .header .buttons { display: flex; justify-content: flex-end; + margin-bottom: var(--gap); } @media screen and (max-width: 900px) { diff --git a/client/components/scroll-to-top/index.tsx b/client/components/scroll-to-top/index.tsx index c470bbc0..1954517e 100644 --- a/client/components/scroll-to-top/index.tsx +++ b/client/components/scroll-to-top/index.tsx @@ -15,10 +15,11 @@ const ScrollToTop = () => { }, []) const isReducedMotion = typeof window !== 'undefined' ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : false - const onClick = (e: React.MouseEvent) => { - // blur the button + const onClick = async (e: React.MouseEvent) => { e.currentTarget.blur() + window.scrollTo({ top: 0, behavior: isReducedMotion ? 'auto' : 'smooth' }) + } return ( diff --git a/client/styles/globals.css b/client/styles/globals.css index e8dcb3cd..b73cab97 100644 --- a/client/styles/globals.css +++ b/client/styles/globals.css @@ -29,7 +29,6 @@ --transition: 0.1s ease-in-out; --transition-slow: 0.3s ease-in-out; - --page-nav-height: 64px; --token: #999; --comment: #999; --keyword: #fff;