1
0
mirror of https://github.com/locomotivemtl/locomotive-boilerplate.git synced 2026-01-15 00:55:08 +08:00
2015-06-01 14:40:18 -04:00
2015-06-01 14:40:18 -04:00
2015-03-20 16:48:15 -04:00
2014-03-01 09:33:24 -08:00
2015-03-13 17:50:29 -04:00

Charcoal-Boilerplate

Boilerplate for Charcoal projects by Locomotive.

Getting started

Setup project

  1. Clone the boilerplate module into your own module
  2. sh clone.sh {{project-name}} - where {{project-name}} is the name of the target project. - Note: on windows, the sh command is usually ran from cygwin.
  3. Create and setup the database
  4. Create an empty database (most people use phpmyadmin...)
  5. Setup the database in www/config/config.json
  6. Setup configuration
  7. Setup the proper URL in in www/config/config.php
  8. Setup languages and project name, if necessary, in www/config/config.json
  9. Initialize Charcoal
  10. Make sure the Charcoal core is installed - Using SVN, this is normally done with a svn:externals property in www/
  11. 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

  2. npm install -g npm-check-updates

  3. npm-check-updates -u

  4. npm install

  5. Run grunt and start coding

  • grunt

Grunt

Each Grunt task has it's own file in the grunt_tasks folder.

BrowserSync

BrowserSync will automatically inject, refresh and sync all your browsers.

Run grunt sync

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 {}).
  • Components: Discrete, complete chunks of UI (e.g. .carousel {}).
  • Trumps: High-specificity, very explicit selectors. Overrides and helper classes (e.g. .hidden {}).

From ITCSS

Grid

We are using a simple inline-block grid system.

Usage

Insert a grid block and add grid__item elements inside it. No rows that contain floats, no twelve columns system; just the number of items you want, with the classes names you want, inside a single block.

  • Include the grid mixins in your components classes.
  • Create custom width grid items by including the grid__item mixin and adding the widths you need or just include the helpers mixins with fractions like names.
  • Add media queries, on the helpers mixins or on your custom components to change the grid items widths, for your content, on different screen sizes.

Demo

Form

We included some basic CSS styles and resets to the form elements so we can easily have custom style form elements that work on every browsers.

Demo

Description
基于数字优先的设计思想的网站模板
Readme MIT 5.2 MiB
Languages
JavaScript 45.8%
SCSS 42.4%
HTML 11.8%