Users report that Shopify’s Forms App cannot be styled using standard CSS methods, making it impossible to match site design. The app uses a shadow DOM and custom elements that ignore external CSS selectors and variable overrides.
Workaround Solution:
A JavaScript-based fix has been shared that modifies the shadow DOM stylesheet directly:
Uses MutationObserver to detect when the form loads
Targets the form-embed element’s shadowRoot
Injects custom CSS rules via CSSStyleSheet
Multiple users confirm this approach works
Implementation Details:
Code should be added to global.js, custom.js, or similar theme JavaScript files
Remove <script> tags when placing in .js files
Target selector may need adjustment (e.g., ‘#app-embed’ instead of ‘.form-container’)
CSS rules must be placed within sheet.insertRule(), not in theme CSS files
Use !important declarations for styles to take effect
Common Issues:
Finding correct element selectors in the shadow DOM
Console errors about null elements when selectors don’t match
Confusion about where to place CSS (should go in JavaScript, not Custom CSS section)
Form display problems on homepage with certain vintage themes
Users express frustration that Shopify’s native app doesn’t adopt standard theme CSS practices.
Summarized with AI on October 28.
AI used: claude-sonnet-4-5-20250929.
The Forms App may not offer all the styling options you need directly within the app. However, you can use custom CSS to make the necessary changes to match the rest of your site.
To apply custom styles to your forms, you’ll need to:
Identify the Form Elements: Inspect the form on your site to find the specific classes or IDs used by the Forms App. You can do this using your browser’s developer tools (right-click on the form element and select “Inspect”).
Add Custom CSS:
•From your Shopify admin, go to Online Store > Themes.
•Find the theme you are currently using, then click Actions > Edit code.
•In the left sidebar, under Assets, find and click on your theme.scss.liquid or theme.css file (depending on your theme).
Write Your Custom CSS: Add your custom CSS targeting the form elements. For example:
Yes, it’s really annoying. It uses some sort of embedding and all the CSS selectors get ignored. Same with overriding the CSS variables. The only way to change the look is using the customizer, but you can only change colors and placement, so it’s lacking.
Hello, I faced the same issue (stemming from the use of a custom element and a shadow DOM), where the CSS styles were not being applied within that element.
However, it is possible to enforce them with JavaScript by modifying the existing shadow DOM stylesheet (it’s not the most elegant solution, but at least it works).
Here’s an example (I had to add an observer to ensure the app is fully loaded):
This code works for me as well! I’m using Shopify Forms on a Dawn-based theme. Only thing is I didn’t know where ‘.form-container’ was supposed to be, so I changed mine to ‘#app-embed’. Great find, thank you for sharing!
In my case, I added it to my custom.js file. If you put it in a .js file, you should remove the tags at the beginning and end of the above code. If you have a global.js file in your theme, that would be a good place to put it (if not, maybe look for main.js or script.js).
I am having this exact issue which I posted here thank you for sharing this, will give this a try. But why is Shopify making an app for their own platform and then making it work in this way instead of just adopting the theme CSS?
@MC_Elliot thanks for this code, I was able to get the form to match my site, but any chance you were able to figure out display it on the homepage? My form displays fine on any page but not my homepage. When I customize my theme and choose the form page in a section on my homepage it does not display. I am on a vintage theme (Outofthesandbox Retina v2.1). The way the forms app works is you have to modify the page template, which I am not sure how to do for the default template which I assume my homepage is using and I am not sure how to change the homepage to use the updated form template? Hoping you might have a tip or suggestion here?
so ive added this to my global.js. after the main CSS you already had, then I add the other classes and edit to my look. but it does not apply the CSS still. Is there a specific way to edit your script for different styling?
i added the class for submit button, but it did not take. What am I doing wrong? i have so much CSS editing for this stupid app to do.
Hmm yeah sounds like something with this line: constform = document.querySelector(‘.form-embed’**). Have you tried constform = document.querySelector(‘#app-embed’**)? That worked with my form code. You need to find a class or id in the divs in your element that doesn’t change when you reload the page. Maybe if the id on your form-embed stays the same, you can use that. Double check your syntax on your variable declaration too. Below is my code for the form and I show where I pulled my ID from.
Does your first declaration for border radius and border work? Your second one will not work because it’s a class and you don’t have a period at the front. It should be:
Heya @MullerMan , yeah I have tried that app-embed id and also a couple of others but it still shows the same error in the console and doesn’t seem to be having any impact on styling.
Quick question, if you don’t mind looking for me, are you seeing any errors in your console?
Hello @MullerMan , I am trying to follow your steps but for some reason I am still unable to change the font size of my forms app. Attached is the code that I entered in the global.js as well as the custom code that I am trying to apply to the website. I would appreciate if you could help me out finding out where my mistake is.
Hey @RobertoLopezMon yes I see what’s going on. You are adding your CSS in the wrong spot. You don’t need to add any in the Custom CSS section, only in the Javascript file on line 1285 where it says sheet.insertRule(``). Replace the contents of it with your css declaration from the top Custom CSS section in the admin. Also, you should add important to it…so font-size: 40px !important;