WP-Starter-Theme-Sass-Webpack
WP-Starter-Theme-Sass-Webpack copied to clipboard
DEPRECATED: WordPress Starter Theme with Sass + Webpack
DEPRECATED: WP Starter Theme with Sass + Webpack
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).
~~Install via WordPress~~ (not yet published on WordPress Themes)
- ~~In your admin panel, go to
Appearance -> Themes
and click theAdd New
button~~ - ~~Type in
WP Starter Theme with Sass + Webpack
in the search form and press theEnter
key on your keyboard~~ - ~~Click on the
Activate
button to use your new theme right away~~
Install via Github
- 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 -> Themes
clickActivate
on theWP Starter Theme with Sass + Webpack
theme
Developing with the theme
- Make sure you have Node + NPM and Yarn Package Manager installed globally
- Open the
src
folder of the theme in your terminal/console - Run
yarn install
- Update the
$dev_hostname
value inheader.php
to your local development hostname - Run
yarn start
- to start the Webpack development scripts - Edit files in
src
and WP PHP files in the theme, the browser will reload (with browser-sync) as you make changes
Production build of the theme
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_script
andwp_enqueue_style
function lines under the Development styles and scripts comment infunctions/enqueue.php
- Un-comment the
wp_enqueue_script
andwp_enqueue_style
function 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.scss
and un-required Font-Awesome (or the whole library) insrc/scss/vendor/font-awesome/scss/font-awesome.scss
CSS Framework
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 Foundation
lines insrc/js/app.js
-
// Foundation
line insrc/scss/app.scss
License
Copyright
WP Starter Theme with Sass + Webpack, Copyright 2017 Dominic Fallows, Distributed under the terms of the MIT license