A user wants to change the discount code text color to white (#FFFFFF) in a Shopify form embedded on their Dawn theme site. The form displays a discount code after email submission, but standard CSS customization isn’t working.
Key Finding:
The form uses a shadow DOM (form-embed element), which blocks external CSS styling. A community member identified this technical barrier and provided a JavaScript workaround:
I have an inline Shopify form added to my website here: https://3rdday.co.uk/#shopify-section-template–23326105829668__1741186850702ce7ae and it provides a discount code when someone enters their email. I want to be able to change the discount code colour to #FFFFFF (which will allow me to change the background of the section - I know it’ll look strange for now) but can’t seem to get it to work using custom CSS. There is no option to change this using the Shopify Forms app or the custom styling options within the section editor (I’m certain). It could be that CSS won’t work and javascript is needed?
IF YOU ENTER YOUR EMAIL ADDRESS ON MY FORM TO TEST THINGS OUT & FIND A FIX, I WILL REMOVE YOUR EMAIL FROM THE MAILING LIST SO YOU DON’T GET ANY MARKETING EMAILS!!!
The form-embed element has a shadow DOM, so that probably explains why you weren’t able to style it. Unless the creator of the form-embed component had exposed parts of the component to be used with ::part() selectors, you wouldn’t be able to style this from the outside using just CSS.
However, using JavaScript, I was able to style it: