Search bar progressively smaller (Dawn)

Search bar progressively smaller (Dawn)

manbru
Pathfinder
112 0 31

Hello,

 

My search bar doesn't adjust to different screen sizes and it certainly doesn't make it progressive. I want the left side to remain stationary while the right side becomes smaller in width. You can first see my search bar and then an example of how I want it to be customized in this video:

https://imgur.com/a/cKtVOCh 

 

I've tried with this code below but it doesn't work and don't do it progressively smaller from the right side of the search bar.

 

<style>
@media only screen and (max-width: 1350px) {
input.search__input.field__input {
    width: auto !important;
}
}
</style>

 

Here is my store:

https://r1vex.myshopify.com/ 

 

 

Thanks for helping!

Replies 3 (3)

BSSCommerce-B2B
Shopify Partner
1718 512 575

@manbru , follow these steps

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

<style>
@media (min-width: 769px) {
  #shopify-section-sections--22029800276294__header > sticky-header > header > div > div.desktop-search > predictive-search > form > div.field > input.search__input.field__input {
    width: 100%!important;
  }
header .header__icons {
  width: 100%!important;
  align-items: center;
}
header .header__heading {
  min-width: 200px
}
.desktop-search {
    width: 100%!important;
    position: unset !important;
    transform: translateX(0) !important;
}
header {
  grid-template-columns: 1fr 5fr!important;
}
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

manbru
Pathfinder
112 0 31

This code worked great however it moved the cart and account icon to the side of it:

Skärmbild 2024-09-11 132305.png

 

I would want the search bar to be in the middle.

Made4uo-Ribe
Shopify Partner
8221 1973 2413

Hi @manbru 

Im not sure what is the original design, without the added code.I manage to make it like this. 

Made4uoRibe_0-1726092404356.pngMade4uoRibe_1-1726092414943.pngMade4uoRibe_2-1726092446998.png

I use this  code. 

 

input.search__input.field__input {
    width: 100%;
    max-width: 100%;
}
@media screen and (min-width: 990px) {
    .search-modal__form {
        max-width: 80%;
    }
}
.header__icons {
    display: flex;
    justify-self: unset;
}

 

And Save. 

 

 

Please don't forget to Like and Mark Solution to the post that helped you. Thanks!

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free.
Need THEME UPDATES but has custom codes? No worries, contact us for affordable price.