How do I change the cart text to white or purple and not black?

Topic summary

Goal: change cart page text color without affecting the rest of a Shopify site, and style buttons purple.

Approach: add page-specific CSS in theme.liquid, wrapped in Liquid conditionals (Shopify’s templating language) so styles only apply on certain templates. Initially scoped to cart; later expanded to cart and product templates to address related elements.

Issues encountered: after the first change, totals, quantities, and some product titles/headers weren’t visible, indicating CSS selectors or scope needed adjustment. A header appearing at the top-left was later fixed by the site owner.

Design request: set button color to the brand purple (RGB 164, 34, 234) and text to white on the targeted pages.

Latest update: helper provided an updated conditional block intended to yield white text and purple buttons on cart and product pages. The site owner reported the button text turned purple but not the background; the helper subsequently observed the button background appearing purple on their end.

Status: partially resolved; awaiting confirmation from the site owner that button backgrounds and all text elements render as intended. Screenshots were central to troubleshooting.

Summarized with AI on January 21. AI used: gpt-5.

Hi, please help me to replace the code you added above with this one:

{% if template.name == 'cart' or template.name =='product' %}

{% endif %}

1 Like