Change "Add to cart" button color in Magento

Change "Add to cart" button color in Magento

August 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Change "Add to cart" button color in Magento

Changing “Add to Cart” Button Color and Text in Magento

Magento is a powerful e-commerce platform that allows you to customize various aspects of your online storefront. One common request from merchants is to change the color of the “Add to cart” button on product pages. In this guide, we’ll walk through the steps required to accomplish this task.

Understanding the Default Styling

By default, Magento uses CSS styles defined in the css directory of your theme folder to style the “Add to cart” button. The relevant file is usually located at:

app/design/frontend/<your_package>/<your_theme>/css/source/_theme.less

Look for a section like this in the file:

button.add-to-cart {
  background: #f69316;
  border-color: #f48d0c;
  color: #fff;
}

Changing the Button Color

To change the button color, you’ll need to modify the background property in the .add-to-cart class. Here’s an example of how to make the button background red:

button.add-to-cart {
  background: #ff0000; // Change this line for a new color
  border-color: #f48d0c;
  color: #fff;
}

Changing the Text Color

To change the text color of the “Add to cart” button, modify the color property:

button.add-to-cart {
  background: #ff0000; // Button color from above
  border-color: #f48d0c;
  color: #000; // Change this line for a new text color
}

Compiling Your Custom CSS

After making your changes, Magento’s built-in LESS compiler will automatically recompile your stylesheet. You can manually trigger the compilation by clicking on “Static View Assets” in the System menu under Configuration > Advanced.

If you are looking to streamline this process or need more advanced customization options, consider using a dedicated CSS framework with Magento. Laravel Spark is an excellent choice for building modern e-commerce sites with integrated CSS and JavaScript components that work seamlessly with Magento. You can learn more about how to integrate Laravel Spark in our guide on building modern e-commerce applications.

Conclusion

Changing the color of the “Add to cart” button is a straightforward process in Magento. By modifying the background and color properties in your theme’s CSS file, you can quickly update the look and feel of this critical e-commerce element.

Remember that any changes made directly to the core files of your Magento installation are not recommended, as they may be overwritten during updates. Always work within your theme directory or use a child theme.

With these steps, you should now have the “Add to cart” button styled exactly how you want it in your Magento storefront.

Checkout Catalog Themes Orders

Our network