Skip to content

Commit

Permalink
assume overflowing initially
Browse files Browse the repository at this point in the history
  • Loading branch information
mucsi96 committed Jun 4, 2024
1 parent da34801 commit da3852c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ header[bt] {
}
}

&:not(.overflowing):has([bt-navbar-toggler]) {
&:has([bt-navbar-toggler])[bt-large-menu] {
& > ul {
margin-right: 3.5rem;
}
Expand All @@ -52,7 +52,7 @@ header[bt] {
}
}

&.overflowing {
&:not([bt-large-menu]) {
& > ul {
visibility: hidden;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Header/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ onElementConnected('header[bt] > nav', (navigation) => {
(entries) => {
const entry = entries[0];
if (!entry.isIntersecting) {
navigation.classList.add('overflowing');
navigation.removeAttribute('bt-large-menu');
} else {
navigation.classList.remove('overflowing');
navigation.setAttribute('bt-large-menu', '');
}
},
{
Expand Down

0 comments on commit da3852c

Please sign in to comment.