2012-11-14 00:42:34 +01:00
# barebones
2016-11-21 13:17:59 +01:00
A lightweight and skeletal WordPress boilerplate theme for HTML5 and beyond. There's lots of these out there but most themes include lots of bloat and files which you might not necessarily need, so we thought we would create our own which is great as a starting point with powerful features to encourage rapid development for most projects.
2012-11-14 00:42:34 +01:00
## Features
2012-12-20 22:33:35 +01:00
* Reset, normalisation and base font/form styles
2017-06-06 16:23:36 +02:00
* Scss Boilerplate - semantically named files, organised by folders, all compiled into a single file
2013-08-06 10:37:22 +02:00
* Semantic use of HTML5 elements, includes Google HTML5 shiv
2012-12-20 22:24:36 +01:00
* WAI-ARIA role ready
2013-10-11 18:24:01 +02:00
* jQuery plugin agnostic
2015-10-20 14:21:57 +02:00
* Basic template files
2012-12-20 22:18:50 +01:00
* Customised functions.php adding theme support for high customisation
2013-01-01 19:11:50 +01:00
* Minimised HTTP requests for high Web Performance
2013-10-11 18:28:37 +02:00
* Localised strings for multiple language support
2017-06-06 16:23:36 +02:00
* Scss compiling and watching, css minification support
* Rollup.js for js for smallest possible bundles
* Image optimisation using imagemin.
2017-08-25 18:11:48 +02:00
* Base mobile nav out of the box
2014-01-30 12:32:16 +01:00
## Installation
2015-10-14 13:01:05 +02:00
Clone the barebones repositories into your WordPress /wp-content/themes/ directory:
2015-03-17 12:15:52 +01:00
2015-08-05 18:13:15 +02:00
git clone https://github.com/benchmarkstudios/barebones
cd barebones
2015-10-14 12:10:55 +02:00
2015-10-20 14:21:57 +02:00
To include all its optional submodules ([Simple Grid](https://github.com/benchmarkstudios/simple-grid) included):
2015-10-14 12:10:55 +02:00
2015-06-11 14:11:42 +02:00
git submodule init
git submodule update
2015-03-17 12:15:52 +01:00
2015-10-14 13:01:51 +02:00
#### Dependencies
2014-01-30 12:32:16 +01:00
2017-06-06 16:23:36 +02:00
Install Dependencies:
```
npm install
```
2014-02-21 11:23:33 +01:00
2017-06-06 16:23:36 +02:00
.. or with yarn:
```
yarn
```
### Using Gulp
2015-10-14 12:48:48 +02:00
2015-10-14 12:51:20 +02:00
Install Gulp as a global NPM package, if you don't have it already on your machine:
2015-10-14 12:44:21 +02:00
npm install --global gulp
2017-06-06 16:23:36 +02:00
Install Dependencies, you have haven't done yet:
2014-01-30 12:32:16 +01:00
2015-04-07 14:38:19 +02:00
npm install
2014-02-07 13:29:13 +01:00
2015-05-12 15:23:58 +02:00
Then run:
2015-10-14 12:31:47 +02:00
gulp
2015-10-14 12:51:20 +02:00
*to compile*
2015-10-14 12:32:25 +02:00
2016-08-09 14:22:26 +02:00
gulp watch
2015-10-14 12:31:47 +02:00
2015-10-14 12:51:20 +02:00
*to watch*
2015-10-14 12:32:25 +02:00
2017-06-06 16:23:36 +02:00
gulp images
*to optimise images*
2017-08-25 18:11:48 +02:00
gulp styles
*to compile styles*
gulp scripts
*to compile scripts*
2017-06-06 16:23:36 +02:00
gulp build
*to create a build (minification, removes map files and comments)*
2015-05-12 15:23:58 +02:00
2017-06-06 16:23:36 +02:00
This will execute all the Gulp tasks on the gulpfile.babel.js.
2015-10-14 12:32:25 +02:00
2017-11-30 14:51:38 +01:00
### Configuration for Gulp
Some of the configuration can be done in `config.barebones.js` file, such as base source and public paths, along with scripts file paths for multiple bundles.
2017-06-06 16:23:36 +02:00
### Images
2017-06-06 16:46:03 +02:00
Drop all your images into assets/images. When running gulp tasks, they will be automatically
2017-06-06 16:23:36 +02:00
optimised and output files will available in img folder in the root of the theme.
2012-12-20 22:24:36 +01:00
2012-12-20 22:33:35 +01:00
## WordPress Support
2012-12-20 22:24:36 +01:00
2014-02-21 11:23:33 +01:00
Compatible with WordPress 3.2 and above, but always use the latest version.
2012-12-20 22:24:36 +01:00
## Browser Support
2014-02-06 16:16:07 +01:00
* Internet Explorer 8.0+
2013-11-21 10:11:13 +01:00
* Firefox 3.0+
* Safari 4.0+
* Chrome 14.0+
* Opera 10.0+
2017-06-06 16:23:36 +02:00
## Tips & Tricks
2017-11-30 14:51:38 +01:00
### SVG Fallbacks
2017-08-25 18:11:48 +02:00
Most likely if you need to support IE8
2017-06-06 16:23:36 +02:00
*CSS*
```
...
background-size: 120px 15px;
background-image: url(/img/fallback.png);
background-image: linear-gradient(transparent, transparent), url(/img/image.svg);
...
```
*HTML*
```
< img src = "/img/logo.svg" onerror = "this.src='/img/logo.png'" alt = "image" / >
```