Note: this theme is now deprecated due to the changes in WordPress since v5.0. Feel free to fork and update for your own usage but I will no longer be updating this repo.
This theme is a starter theme for WordPress that utilises modern development workflows and tools, like SASS, Webpack, Babel, Browsersync and a CSS framework (Foundation 6 for Sites, optional).
In your admin panel, go toAppearance -> Themesand click theAdd NewbuttonType inWP Starter Theme with Sass + Webpackin the search form and press theEnterkey on your keyboardClick on theActivatebutton to use your new theme right away
- In Terminal/CMD, from the WordPress Themes folder
/wp-content/themes/, rungit clone https://github.com/dominicfallows/WP-Starter-Theme-Sass-Webpack.git - In your admin panel, go to
Appearance -> ThemesclickActivateon theWP Starter Theme with Sass + Webpacktheme
- Make sure you have Node + NPM and Yarn Package Manager installed globally
- Open the
srcfolder of the theme in your terminal/console - Run
yarn install - Update the
$dev_hostnamevalue inheader.phpto your local development hostname - Run
yarn start- to start the Webpack development scripts - Edit files in
srcand WP PHP files in the theme, the browser will reload (with browser-sync) as you make changes
yarn start from above creates uncompressed (un-minified) development versions of the CSS and JS files. Before pushing your files to a production environment you should create production ready versions. To do this:
- Run
yarn build - Comment out the
wp_enqueue_scriptandwp_enqueue_stylefunction lines under the Development styles and scripts comment infunctions/enqueue.php - Un-comment the
wp_enqueue_scriptandwp_enqueue_stylefunction lines under the Production styles and scripts lines infunctions/enqueue.php - You can further compress the production assets by commenting out the un-required Foundation components in
src/scss/app.scssand un-required Font-Awesome (or the whole library) insrc/scss/vendor/font-awesome/scss/font-awesome.scss
This starter theme uses Foundation 6 for Sites. You can easily swap this for a framework of your choice, to do this update the following:
// Import Foundationlines insrc/js/app.js// Foundationline insrc/scss/app.scss
WP Starter Theme with Sass + Webpack, Copyright 2017 Dominic Fallows, Distributed under the terms of the MIT license