Skip to content

Commit

Permalink
fix: adjust min-height of css as a dynamic variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShi-1 committed Oct 8, 2024
1 parent 6d39627 commit 1bc573e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sections/error-page/ErrorPage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
min-height: $main-container-available-height;
min-height: var(--error-min-height);
}

.middle-search-cta-wrapper {
Expand Down
5 changes: 5 additions & 0 deletions src/sections/error-page/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export function ErrorPage() {
useErrorLogger(error)
const theme = useTheme()

const header = document.querySelector('nav')
const footer = document.querySelector('footer')
const newMinHeight = header && footer ? '$main-container-available-height' : '100vh'
document.documentElement.style.setProperty('--error-min-height', newMinHeight)

return (
<section className={styles['section-wrapper']}>
<div className={styles['middle-search-cta-wrapper']}>
Expand Down

0 comments on commit 1bc573e

Please sign in to comment.