File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 2727 box-sizing : border-box;
2828}
2929
30+ @media (min-width : 1040px ) and (max-width : 1280px ) {
31+ .site-header__container {
32+ gap : var (--space-sm );
33+ padding : 0 var (--space-md );
34+ }
35+ }
36+
3037@media (max-width : 767px ) {
3138 .site-header__container {
3239 padding : 0 var (--space-md );
153160 margin : 0 ;
154161 }
155162
163+ @media (max-width : 1280px ) {
164+ .site-header__navigation ul {
165+ gap : var (--space-md );
166+ }
167+ }
168+
156169 .site-header__navigation li {
157170 margin : 0 ;
158171 padding : 0 ;
Original file line number Diff line number Diff line change 1- // Mobile Menu Toggle - Simple and Robust
2-
31// Wait for DOM to be fully loaded
42document . addEventListener ( 'DOMContentLoaded' , function ( ) {
53 const menuToggle = document . getElementById ( 'mobile-menu-toggle' ) ;
Original file line number Diff line number Diff line change @@ -13,10 +13,14 @@ const headerContainer = document.querySelector(".site-header__container");
1313let searchItemSelected = null ;
1414let resultsItemsIndex = - 1 ;
1515
16- // Function to update search container class based on input content
16+ // Function to update search container class based on input content and focus
1717function updateSearchContainerClass ( ) {
1818 if ( searchInput && searchContainer ) {
19- if ( searchInput . value . trim ( ) !== "" ) {
19+ const hasContent = searchInput . value . trim ( ) !== "" ;
20+ const isFocused = document . activeElement === searchInput ;
21+
22+ // Keep expanded if input has content OR is focused
23+ if ( hasContent || isFocused ) {
2024 searchContainer . classList . add ( "has-content" ) ;
2125 if ( headerContainer ) {
2226 headerContainer . classList . add ( "search-expanded" ) ;
@@ -213,13 +217,15 @@ function initSearch() {
213217 updateSearchContainerClass ( ) ;
214218 } ) ;
215219 searchInput . addEventListener ( "focusin" , function ( ) {
220+ updateSearchContainerClass ( ) ;
216221 if ( searchInput . value !== "" ) {
217222 showResults ( index ) ( ) ;
218223 }
219224 } ) ;
220225
221226 searchInput . addEventListener ( "focusout" , function ( ) {
222227 resultsItemsIndex = - 1 ;
228+ updateSearchContainerClass ( ) ;
223229 } ) ;
224230
225231 window . addEventListener ( "click" , function ( mouseEvent ) {
Original file line number Diff line number Diff line change 1919
2020 <!-- Search (always visible, but styled differently on mobile) -->
2121 < div class ="site-header__search ">
22- < input type ="search " id ="search " autocomplete ="off " placeholder ="Search docs and API... ">
22+ < input type ="search " id ="search " autocomplete ="off " placeholder ="Search the documentation and API… ">
2323 < div id ="search-results " class ="search-results ">
2424 < ul id ="search-results__items " class ="search-results__items "> </ ul >
2525 </ div >
You can’t perform that action at this time.
0 commit comments