Skip to content


Subversion checkout URL

You can clone with
Download ZIP
:floppy_disk: 2012 — A methodology for documenting CSS and generating styleguides
Ruby CoffeeScript
Pull request Compare This branch is 96 commits behind kneath:master.
Latest commit 249adad @d2s Fix link from README
There was a broken link with 404. Now it's gone.
Failed to load latest commit information.
example Update example Gemfile
lib 0.3.0
test Merge pull request #30 from derekr/master
.gitignore Ignore SASS's cache
Gemfile Look at all of the dependencies I don't need anymore
LICENSE Add a license Fix link from README
Rakefile Actually make gem publishing work Apply Giles' changes to

Knyle Style Sheets

Inspired by TomDoc, KSS attempts to provide a methodology for writing maintainable, documented CSS within a team. Specifically, KSS is a documentation specification and styleguide format. It is not a preprocessor, CSS framework, naming convention, or specificity guideline.

KSS in a nutshell

The methodology and ideas behind Knyle Style Sheets are contained in At it's core, KSS is a documenting syntax for CSS.

A button suitable for giving stars to someone.

:hover             - Subtle hover highlight.
.stars-given       - A highlight indicating you've already given a star.
.stars-given:hover - Subtle hover highlight on top of stars-given styling.
.disabled          - Dims the button to indicate it cannot be used.

Styleguide 2.1.3.

Ruby Library

This repository includes a ruby library suitable for parsing SASS, SCSS, and CSS documented with KSS guidelines. To use the library, include it in your project as a gem from Then, create a parser and explore your KSS.

styleguide ="#{RACK_ROOT}public/stylesheets")

# => <Kss::Section>

# => "A button suitable for giving stars to someone."

# => <Kss::Modifier>

# => ':hover'

# => 'pseudo-class-hover'

# => 'Subtle hover highlight'

The library is also fully TomDoc'd, completing the circle of life.

Generating styleguides

The documenting syntax and ruby library are intended to generate styleguides automatically. To do this, you'll need to leverage a small javascript library that generates class styles for pseudo-class styles (:hover, :disabled, etc).

For an example of how to generate a styleguide, check out the example sinatra application.


To hack on KSS, you'll need to install dependencies with bundle install. Run tests with rake.

To make your life easier, I suggest bundle install --binstubs and adding bin/ to your $PATH. If you don't understand this, just blindly add bundle exec in front of everything you'd normally do, like bundle exec rake.

I apologize on behalf of the Ruby community for this, it's embarrassing and disappointing that dependency management is still so clumsy.

Something went wrong with that request. Please try again.