Hi
I have the code(CSS and HTML) of a pre-loader animation
I want to know where to add that code so that this pre-loader works on all pages while they’re loading
Note * I have the code I’m not interested in any apps I know about a bunch of apps but I don’t want to use an app for that
Hello @HamzaIbadat
To add a pre-loader animation to your Shopify store, you’ll need to modify your theme code. Specifically, you’ll need to add the HTML and CSS code for the pre-loader to your theme’s “theme.liquid” file, which is a template that controls the overall layout of your store.
Here’s how you can do it:
- From your Shopify admin dashboard, click “Online Store” and then “Themes”.
- Find the theme you want to edit and click “Actions” and then “Edit Code”.
- In the left-hand sidebar, click on the “Layout” folder and select “theme.liquid”.
- Scroll down to the bottom of the file and add the HTML code for your pre-loader. You can add it just above the closing
</body> tag to ensure it appears on all pages.
- Next, you’ll need to add the CSS code for your pre-loader. You can either add it to the “theme.scss.liquid” file or create a new CSS file and link to it in the “theme.liquid” file. Make sure the CSS code is located within
<style> tags.
- Save your changes.
Once you’ve added the pre-loader code to your theme, it should appear on all pages while they’re loading.
Note: Keep in mind that modifying your theme code can be tricky, and even small errors can cause big problems. It’s a good idea to back up your theme before making any changes and to test your pre-loader thoroughly to ensure it’s working correctly. If you’re not comfortable modifying your theme code, you may want to consider hiring a Shopify developer to assist you.
I’m using the dawn theme and it didn’t have any “theme.scss.liquid”
So I created a new custom css file and it was empty there were no tags it was completely empty
Hi @HamzaIbadat
You have theme.liquid in dawn theme. You should paste all your code just before the closing of body tag.