2014-10-09 10:33:09 -04:00
Charcoal-Boilerplate
2015-03-13 12:47:44 -04:00
====================
2014-03-01 09:33:24 -08:00
2014-10-09 10:33:09 -04:00
Boilerplate for [`Charcoal` ](#http://charcoal.locomotive.ca ) projects by Locomotive.
2015-02-15 15:44:11 -05:00
2015-03-05 14:57:47 -05:00
## Getting started
2015-03-13 12:47:44 -04:00
### Setup project
2015-03-17 12:14:04 -04:00
2015-03-13 12:47:44 -04:00
1. **Clone the boilerplate module into your own module **
2015-03-17 12:14:04 -04:00
1. `sh clone.sh {{project-name}}`
2015-03-13 12:47:44 -04:00
- where `{{project-name}}` is the name of the target project.
- Note: on windows, the `sh` command is usually ran from cygwin.
2. **Create and setup the database **
1. Create an empty database (most people use phpmyadmin...)
2. Setup the database in `www/config/config.json`
3. **Setup configuration **
1. Setup the proper `URL` in in `www/config/config.php`
2. Setup languages and project name, if necessary, in `www/config/config.json`
4. **Initialize Charcoal **
1. Make sure the Charcoal core is installed
- Using SVN, this is normally done with a `svn:externals` property in `www/`
2. Setup a local admin user
- Visit `http://{{project-url}}/admin` to start the admin user creation wizard.
### Install the node modules / grunt
1. **Get the latest node modules **
1. `npm install -g npm-check-updates`
2. `npm-check-updates -u`
3. `npm install`
2. **Run grunt and start coding **
- `grunt`
2015-03-05 14:57:47 -05:00
2015-02-15 15:44:11 -05:00
## SCSS
### Import order
* **Settings:** Global variables, site-wide settings, config switches, etc.
* **Tools:** Site-wide mixins and functions.
* **Generic:** Low-specificity, far-reaching rulesets (e.g. resets).
* **Base:** Unclassed HTML elements (e.g. `a {}` , `blockquote {}` , `address {}` ).
* **Objects:** Objects, abstractions, and design patterns (e.g. `.media {}` ).
2015-02-16 12:36:58 -05:00
* **Components:** Discrete, complete chunks of UI (e.g. `.carousel {}` ).
2015-02-15 15:44:11 -05:00
* **Trumps:** High-specificity, very explicit selectors. Overrides and helper
classes (e.g. `.hidden {}` ).
*From [ITCSS ](https://twitter.com/itcss_io )*
2015-03-06 10:15:49 -05:00
### Grid
We are using a simple inline-block grid system.
2015-03-06 11:08:43 -05:00
**Usage**
2015-03-06 10:15:49 -05:00
2015-03-17 12:14:04 -04:00
Insert a `%grid` block and add `%grid__item` elements inside it.
2015-03-06 11:08:43 -05:00
No rows that contain floats, no twelve columns system; just the number of items you want, with fractions like names helpers * (ex: `%third`, `%two-thirds`) * , inside a single block.
2015-03-06 10:15:49 -05:00
2015-03-17 12:14:04 -04:00
- Extend the placeholder selectors * (`%`) * for more semantic ones to your components.
2015-03-06 11:08:43 -05:00
- Create custom width grid items by extending the `%grid__item` and adding widths in a fraction format, with the `span()` function.
- Add media queries, on the helpers selectors or on your custom components, with the `$from` and `$to` variables to change the grid items widths, for your content, on different screen sizes .
2015-03-06 10:15:49 -05:00
*[Demo ](http://codepen.io/AntoineBoulanger/pen/EaLNxe )*