GithubHelp home page GithubHelp logo

middleman-kss's Introduction

middleman-kss

middleman-kss provides KSS helpers for Middleman. With these helpers, you can easily insert KSS styleguide blocks. Great for creating styleguides or design guidelines.

P.S. This gem was mainly created to be used with my middleman-styleguide-template, which I use for creating styleguides and other documentation.

Installation

Add this line to your Middleman project Gemfile:

gem 'middleman-kss'

And then execute:

$ bundle

Open your config.rb and add the required settings:

set :markdown_engine, :redcarpet
activate :kss, :kss_dir => 'stylesheets/external'

Note: The :kss_dir should be set so all the url('...')s in your CSS map correctly.

Create a styleblocks-directory under source/

$ mkdir source/styleblocks

And read the next chapter for usage instructions.

Usage

Okay, here's the deal:

  1. Write your CSS/SCSS/LESS in KSS
  2. Insert your CSS/SCSS/LESS into the kss_dir
  3. Create individual style blocks into source/styleblocks
    • Name them like this: _buttons.html.erb, you know
  4. Use the helpers to print the style blocks

See my middleman-styleguide-template for examples!

Helpers

styleblock <%= styleblock 'filename', [section: '1.1'] %>

Renders the styleblock named filename.

Optional: section parameter maps the rendered styleblock to a KSS section, which will expand the section into a fully documented KSS styleblock with all the available classes and such.

Examples:

<%= styleblock 'buttons' %>
<%= styleblock 'buttons', section: '1.1' %>

Contributing

Contributions are most welcome! And well-tested and documented contributions are more welcome than others ;)

  1. Fork the repository
  2. Create a branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a pull request

middleman-kss's People

Contributors

darep avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.