reduce quantity input box

Topic summary

A user needs to reduce the size of the quantity input box on their Shopify mobile product page, as it appears too large.

Initial Solution:
One responder provided CSS code to be added to the theme.liquid file (above the </body> tag), which successfully reduced the quantity input size.

Follow-up Issue:
The original poster then asked how to reduce both the quantity input and cart sizes on mobile, noting the initial solution didn’t work for this broader request.

Comprehensive Solution:
Another contributor offered more extensive CSS code to be added to the theme’s CSS file (base.css, style.css, or theme.css). This solution includes:

  • Adjustments to .quantity__button width
  • Modifications to .price-per-item__container .quantity width
  • Media query for desktop screens (min-width: 990px) targeting .quantity-popover-container

The discussion includes code snippets and visual examples showing the before/after results. The issue appears resolved with the more comprehensive CSS approach.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

For the mobile version I need to modify the quantity input button size for the single

product page (when you select a product and it opens the button for selecting the quantity is too big)

mohwhi

2 Likes

Hey @sosober

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to solve your problem then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

Thank you! Can i also ask you how to reduce the size of both quantity input and cart on mobile version? Because it does not work

Hi @sosober

Check this one.

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
.quantity__button {
    width: calc(2.5rem / var(--font-body-scale));
}
.price-per-item__container .quantity {
    width: calc(8rem / var(--font-body-scale) + var(--inputs-border-width) * 2) !important;
}

@media screen and (min-width: 990px) {
    .quantity-popover-container {
        width: 10rem !important;
    }
.quantity-popover-container .quantity {
    width: calc(8rem / var(--font-body-scale) + var(--inputs-border-width) * 2) !important;
}
}

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