brandonreid / documentcss_starter-kit

A ready-to-go starter kit for creating pattern libraries with DocumentCSS.
11 stars 4 forks source link

DocumentCSS Starter Kit

DocumentCSS is an awesome way to document style patterns as you make them. This starter kit was built to make it super easy to get started.

Speaking of getting started...

Getting Started

Install

  1. Clone this repo.
  2. Transfer the contents into your own style guide repo. You'll want to update stuff in the package.json file to reference your style guide repo.
  3. Run npm install
  4. Install gulp globally if you never have: npm install -g gulp
  5. Optionally you can install documentjs globally so you can run the documentjs build command: npm install -g documentjs.

Running

Run gulp dev to compile the style guide and run a live reloading local server at http://localhost:4200/. You can change the port number in gulpfile.js.

Couple notes...

How this is structured.

The strategy here is that your core styles patterns are in their own repo with a style guide that others can reference. Then these styles are imported into your apps (the compiled styles from the dist folder), you'll have additional app view specific styles that don't necessarily cut it as a pattern in the app's own repo. If you develop a repeatable pattern in an app, transfer it to the style guide! You'll be able to document it quickly and easily.

After you npm install and run gulp dev for the first time, you'll have a folder structure like this.

How to do stuff.

Documenting styles as you go.

If you checkout the buttons.less example file in the less folder, you can get an idea how it works.

Pages

You can also use @group and other cool stuff to organize your documentation. Learn more at documentcss.com.

Individual Style Demos

Customizing the Style Guide

Deploying

The styleguide folder is your generated pattern library. You can upload that to any server or use github pages to host it.