Skip to content

Commit

Permalink
Use calc-size
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Nov 21, 2024
1 parent 2041b23 commit f305620
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions source/css/_mixins.styl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ toggle-close($position) {
}

site-nav-hide-by-default() {
--scroll-height: 0;
height: 0;
overflow: hidden;
transition: $transition-ease;
Expand All @@ -238,7 +237,7 @@ site-nav-hide-by-default() {
}

body.site-nav-on & {
height: var(--scroll-height);
height: calc-size(auto, size);
visibility: unset;
}
}
Expand Down
1 change: 0 additions & 1 deletion source/js/next-boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ NexT.boot.registerEvents = function() {
event.currentTarget.classList.toggle('toggle-close');
const siteNav = document.querySelector('.site-nav');
if (!siteNav) return;
siteNav.style.setProperty('--scroll-height', siteNav.scrollHeight + 'px');
document.body.classList.toggle('site-nav-on');
});

Expand Down

0 comments on commit f305620

Please sign in to comment.