|
| 1 | +This website is a work in progress. |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +# Start package for [Bulma](http://bulma.io) |
| 6 | + |
| 7 | +Tiny npm package that includes the `npm` **dependencies** you need to **build your own website** with Bulma. |
| 8 | + |
| 9 | +<a href="http://bulma.io"><img src="https://raw.githubusercontent.com/jgthms/bulma-start/master/bulma-start.png" alt="Bulma: a Flexbox CSS framework" style="max-width:100%;" width="600" height="315"></a> |
| 10 | + |
| 11 | +## Install |
| 12 | + |
| 13 | +```sh |
| 14 | +npm install bulma-start |
| 15 | +``` |
| 16 | +_or_ |
| 17 | + |
| 18 | +```sh |
| 19 | +yarn add bulma-start |
| 20 | +``` |
| 21 | + |
| 22 | +## What's included |
| 23 | + |
| 24 | +The `npm` dependencies included in `package.json` are: |
| 25 | + |
| 26 | +* <code>[bulma](https://github.com/jgthms/bulma)</code> |
| 27 | +* <code>[node-sass](https://github.com/sass/node-sass)</code> to compile your own Sass file |
| 28 | +* <code>[postcss-cli](https://github.com/postcss/postcss-cli)</code> and <code>[autoprefixer](https://github.com/postcss/autoprefixer)</code> to add support for older browsers |
| 29 | +* <code>[babel-cli](https://babeljs.io/docs/usage/cli/)</code>, <code>[babel-preset-env](https://github.com/babel/babel-preset-env)</code> and <code>[babel-preset-es2015-ie](https://github.com/jmcriffey/babel-preset-es2015-ie)</code> for compiling ES6 JavaScript files |
| 30 | + |
| 31 | +Apart from `package.json`, the following files are included: |
| 32 | + |
| 33 | +* `.babelrc` configuration file for [Babel](https://babeljs.io/) |
| 34 | +* `.gitignore` common [Git](https://git-scm.com/) ignored files |
| 35 | +* `index.html` this HTML5 file |
| 36 | +* `_sass/main.scss` a basic SCSS file that **imports Bulma** and explains how to **customize** your styles, and compiles to `css/main.css` |
| 37 | +* `_javascript/main.js` an ES6 JavaScript that compiles to `lib/main.js` |
| 38 | + |
| 39 | + |
| 40 | +## Get your feet wet |
| 41 | + |
| 42 | +This package is meant to provide a **good starting point** for working with Bulma. |
| 43 | + |
| 44 | +When installing this package with the commands above, it landed in `$HOME/node_packages/bulma-start`. |
| 45 | +In order to use it as a **template** for your **project**, you might consider copying it to a better suited location: |
| 46 | + |
| 47 | +```sh |
| 48 | +cd $HOME/projects |
| 49 | +cp -a $HOME/node_modules/bulma-start my-bulma-project |
| 50 | +``` |
| 51 | + |
| 52 | +Alternatively, you could do something similar with a GitHub clone as well. |
| 53 | + |
| 54 | +```sh |
| 55 | +cd $HOME/projects |
| 56 | +git clone https://github.com/jgthms/bulma-start |
| 57 | +mv bulma-start my-bulma-project |
| 58 | +rm -rf my-bulma-project/.git # cut its roots |
| 59 | +``` |
| 60 | + |
| 61 | +Now, that you prepared the groundwork for your project, set up Bulma and run the watchers: |
| 62 | + |
| 63 | +```sh |
| 64 | +cd my-bulma-project |
| 65 | +npm install |
| 66 | +npm start |
| 67 | +``` |
| 68 | + |
| 69 | +As long as `npm start` is running, it will **watch** your changes. You can edit `_sass/main.scss` and `_javascript/main.js` at will. Changes are **immediately** compiled to their destinations, where `index.html` will pick them up upon reload in your browser. |
| 70 | + |
| 71 | +Some controlling output is written to the `npm start` console in that process: |
| 72 | + |
| 73 | +```sh |
| 74 | +_javascript/main.js -> lib/main.js |
| 75 | + |
| 76 | +=> changed: $HOME/projects/start-with-bulma/_sass/main.scss |
| 77 | +Rendering Complete, saving .css file... |
| 78 | +Wrote CSS to $HOME/projects/start-with-bulma/css/main.css |
| 79 | +``` |
| 80 | + |
| 81 | +Use `npm run` to show all available commands: |
| 82 | + |
| 83 | +```sh |
| 84 | +Lifecycle scripts included in bulma-start: |
| 85 | + start |
| 86 | + npm-run-all --parallel css-watch js-watch |
| 87 | + |
| 88 | +available via `npm run-script`: |
| 89 | + css-build |
| 90 | + node-sass _sass/main.scss css/main.css |
| 91 | + css-deploy |
| 92 | + npm run css-build && npm run css-postcss |
| 93 | + css-postcss |
| 94 | + postcss --use autoprefixer --output css/main.css css/main.css |
| 95 | + css-watch |
| 96 | + npm run css-build -- --watch |
| 97 | + deploy |
| 98 | + npm run css-deploy && npm run js-build |
| 99 | + js-build |
| 100 | + babel _javascript --out-dir lib |
| 101 | + js-watch |
| 102 | + npm run js-build -- --watch |
| 103 | +``` |
| 104 | + |
| 105 | +If you want to learn more, follow these links: [Bulma homepage](http://bulma.io) and [Documentation](http://bulma.io/documentation/overview/start/). |
| 106 | + |
| 107 | + |
| 108 | +## Copyright and license |
| 109 | + |
| 110 | +Code copyright 2017 Jeremy Thomas. Code released under [the MIT license](https://github.com/jgthms/bulma-start/blob/master/LICENSE). |
0 commit comments