Can I upload a single css file to my assets folder using VSC and Shopify CLI

Can I upload a single css file to my assets folder using VSC and Shopify CLI

Driver3
Shopify Partner
30 1 1

Or upon saving the file?

Reply 1 (1)

Harris3
Excursionist
17 1 1

Hello,

 

Yes, you can upload a single CSS file to your assets folder using Visual Studio Code and the Shopify CLI. First, ensure your theme is set up for development with the Shopify CLI.

 

Use the command shopify theme pull to download the current version of your theme to your local environment. Next, add your CSS file to the assets folder in your local theme directory, such as assets/custom-style.css. Then, run the command shopify theme push in your terminal to upload the new file to your Shopify theme.

 

If you want changes to upload automatically when you save a file, you can use the command shopify theme serve. This syncs your local changes to the theme in real-time. Finally, include your CSS file in your theme by editing the appropriate Liquid file, such as theme.liquid, and adding a link tag to load your CSS file in the head section of the page.

 

Let me know if you have some other questions.

Gail Harris