Shopify themes, liquid, logos, and UX
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:
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:
Thanks for helping!
@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
This code worked great however it moved the cart and account icon to the side of it:
I would want the search bar to be in the middle.
Hi @manbru
Im not sure what is the original design, without the added code.I manage to make it like this.
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!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025