5/9/2023 0 Comments Minify css with codekitTo change where the theme.scss file gets output, simply click on the file you want to change the output path for, and then select the directory you wish it to output to. However, if you’ve set up the SCSS folder structure outlined above, you’ll want to make sure that Prepros knows where to output the compiled styles/theme.scss file. Choose which files to watch, and what you want to compile whereīy default, Prepros will be watching for changes to any files inside your project.If you just want to get live reloading working with your CSS file, you don’t need to do much more configuration. gitignore, so that you don’t track or commit changes for your Prepros configuration (unless you want to). If you’re using Git, you may want to add a rule to your. This file contains the configuration settings for your project, such as where certain assets get compiled, whether you’ve enabled various settings, and so on. Prepros will create a nfig file in your project directory. Alternatively, you can click on the + at the bottom left of the Prepros app, to add a project. Now that we’ve figured out which files we want to edit (CSS or SCSS), and set those up, we can now dig into Prepros! Add your theme as a projectįirst, add your theme as a project to Prepros, by simply dragging the entire directory into the Prepros app. your styles/ directory) on Github, or some other form of version control. This is totally fine - just note that you should make sure to save the whole theme, with all the working files (ie. zip the theme and upload it, you’ll find that the styles/ directory isn’t included. In Shopify Themes, any additional top level directories are ignored by both Theme Kit and Shopify servers. Your styles folder is ignored automatically Note: when importing partials, there’s no need to include the _ in your statement. Then the stylesheet into the top of theme.scss. If the stylesheet doesn’t have any Liquid objects, you can simply copy the stylesheet file into vendor/, and rename into a partial with a preceding _, such as _name-of-file.scss. Prepros can’t compile Liquid, thus the compiler will error-out if you try to use a file containing Liquid objects with a. You can do this provided that the existing file doesn’t include any Liquid objects. Importing an existing stylesheet into your SCSS structureĪdditionally, you might want to import an existing stylesheet into your fancy new SCSS folder structure. In the of your markup, add in the following code, after the original stylesheet: To add an additional custom CSS file, simply go into the layout directory, and locate the theme.liquid file. For small tweaks to the existing theme, I suggest adding an additional stylesheet for your changes, or appending changes to the CSS at the bottom of the original CSS file. To customize an existing theme, you’ll need to either add in a new stylesheet or amend an existing one. Link your styles to theme.liquid Using CSS in an existing theme This ensures that the changes you make directly to a CSS file, whether through Prepros SCSS compilation or direct editing, are tracked and then synced to Shopify’s servers and your store. The final step with Theme Kit is to run the theme watch command. I’m going to cover two ways of using live reloading with Shopify Themes with regular old CSS files, and with Sass (SCSS) compilation. To do this you can follow the instructions provided through the Theme Kit tutorial. Install and connect Theme Kitīefore we get into hooking up live reloading with Prepros, you’ll need to have already set up Theme Kit with the theme you will be working on. Join for free and access revenue share opportunities, tools to grow your business, and a passionate commerce community. Whether you offer marketing, customization, or web design and development services, the Shopify Partner Program will set you up for success. Grow your business with the Shopify Partner Program
0 Comments
Leave a Reply. |