File tree Expand file tree Collapse file tree 5 files changed +42
-9
lines changed
Expand file tree Collapse file tree 5 files changed +42
-9
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ body {
4242 color var (--duration-normal ) var (--ease-out );
4343}
4444
45+ @media (max-width : 767px ) {
46+ body {
47+ padding-top : 0 ;
48+ }
49+ }
50+
4551/* Reset spacing */
4652* + * {
4753 margin-top : 1.5em ;
Original file line number Diff line number Diff line change 3535}
3636
3737@media (max-width : 767px ) {
38+ .site-header {
39+ position : relative;
40+ }
41+
3842 .site-header__container {
3943 padding : 0 var (--space-md );
4044 gap : var (--space-sm );
Original file line number Diff line number Diff line change 77 transition : background-color var (--duration-normal ) var (--ease-out );
88}
99
10+ @media (max-width : 767px ) {
11+ .layout-container {
12+ margin-top : var (--header-height );
13+ }
14+ }
15+
1016/* One Column Layout - Modern Content */
1117.one-column-layout {
1218 margin : 0 auto;
Original file line number Diff line number Diff line change 3636 height : 16px ;
3737 color : var (--color-light-link );
3838 flex-shrink : 0 ;
39+ pointer-events : none;
3940}
4041
4142.site-header__search-trigger .search-trigger-text {
4546 overflow : hidden;
4647 text-overflow : ellipsis;
4748 font-weight : 400 ;
49+ pointer-events : none;
4850}
4951
5052.site-header__search-trigger .search-shortcut {
383385
384386@media (max-width : 768px ) {
385387 .search-modal {
386- padding : 16 px ;
388+ padding : 8 px ;
387389 align-items : flex-start;
388390 }
389391
390392 .search-modal__container {
391393 max-width : 100% ;
392394 width : 100% ;
393395 height : auto;
394- max-height : calc (100dvh - 32 px );
395- max-height : calc (var (--vh , 1vh ) * 100 - 32 px ); /* Fallback for browsers without dvh support */
396+ max-height : calc (100dvh - 12 px );
397+ max-height : calc (var (--vh , 1vh ) * 100 - 12 px ); /* Fallback for browsers without dvh support */
396398 }
397399
398400 .search-modal__content {
399401 border-radius : var (--radius-lg );
400402 height : auto;
401- max-height : calc (100dvh - 32 px );
402- max-height : calc (var (--vh , 1vh ) * 100 - 32 px );
403+ max-height : calc (100dvh - 12 px );
404+ max-height : calc (var (--vh , 1vh ) * 100 - 12 px );
403405 }
404406
405407 /* When results are visible, expand to full height */
406408 .search-modal__content : has (.search-modal__results [style *= "display: block" ]) {
407- height : calc (100dvh - 32 px );
408- height : calc (var (--vh , 1vh ) * 100 - 32 px );
409+ height : calc (100dvh - 12 px );
410+ height : calc (var (--vh , 1vh ) * 100 - 12 px );
409411 }
410412
411413 .search-modal__input-wrapper {
Original file line number Diff line number Diff line change 11// Get the button:
22let mybutton = document . getElementById ( "back-to-top-button" ) ;
33
4- // When the user scrolls down 300px from the top of the document, show the button
4+ // Track last scroll position for detecting scroll direction
5+ let lastScrollTop = 0 ;
6+ let isScrollingUp = false ;
7+
8+ // When the user scrolls, check position and direction
59window . onscroll = function ( ) { scrollFunction ( ) } ;
610
711function scrollFunction ( ) {
8- if ( document . body . scrollTop > 300 || document . documentElement . scrollTop > 300 ) {
12+ const currentScrollTop = document . body . scrollTop || document . documentElement . scrollTop ;
13+
14+ // Determine scroll direction
15+ if ( currentScrollTop < lastScrollTop ) {
16+ isScrollingUp = true ;
17+ } else {
18+ isScrollingUp = false ;
19+ }
20+ lastScrollTop = currentScrollTop <= 0 ? 0 : currentScrollTop ;
21+
22+ // Show button only when scrolling up AND past 300px (all resolutions)
23+ if ( currentScrollTop > 300 && isScrollingUp ) {
924 mybutton . classList . add ( "visible" ) ;
1025 } else {
1126 mybutton . classList . remove ( "visible" ) ;
You can’t perform that action at this time.
0 commit comments