How do I compile my theme styles?

To compile the styles of your theme you first need to change directory in terminal to your theme folder:

cd your_project/themes/your_theme_name

 

Compiling your styles

Our themes are built to use npm, the webpack.mix.js file contains the required code to compile tailwind styles into a minified css file.

 

Development

Running the following command in terminal will constantly watch changes made to your theme and add any tailwind helpers to the main.css file if you add any. This is the best method to use while in development, however the css file size will be much bigger and disrupt your site speeds.

npm run watch

 

Production

When your project is ready for production you can run this alternative command in your terminal this will minify your styles and remove any unused css from the final build giving you optimal site speeds.

npm run production

Articles in this section

Was this article helpful?
0 out of 0 found this helpful