Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CoffeeScript JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
templates
test
.gitignore
.npmignore
LICENSE-MIT
README.md
app.js
grunt.js
package.json
templates.scss

README.md

styleguide

Just a placeholder for a project we're working on. The styleguide generators a pretty crappy at the moment. We want to do it better. We're making a few assumptions:

* You write BEM-style code, with blocks, elements and modifiers
* You write Sass

Getting Started

Install the module with: npm install styleguide

var styleguide = require('styleguide');
styleguide.awesome(); // "awesome"

Comment Syntax

// # Primary Button
//
// The primary button style. Used for most call to actions
// 
//  - You can do lists
//  - Any markdown for the description
//
// Everything before the tags is considered the description. Any
// tags will be available as variables within the template
//
// @type button
// @section buttons
// @modifier .btn--small A smaller version
// @modifier .btn--large A larger version
// @template buttons/btn
.btn {

  // Smaller button style
  // @modifier .btn--small
  // @modifies .btn
  &.btn--small {

  }

}

Figuring out how to do modifiers is tricky. It's also difficult parsing the scss. We are just parsing the comments and not parsing the scss so we don't know what selectors come after the comments. Even if we did we wouldn't know what to do with them, like with the modifier &.btn--small. We would need to use a compiled version of the sass to figure it out OR we would have to insist that modifiers aren't nested within their blocks.

Documentation

(Coming soon)

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

Todo

  • Mixin documentation
  • Function documentation
  • Variable docs
  • Swatches

License

Copyright (c) 2012 Anthony Short
Licensed under the MIT license.

Something went wrong with that request. Please try again.