Need help with kss?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

4.1K Stars 296 Forks MIT License 183 Commits 36 Opened issues


A methodology for documenting CSS and generating styleguides.

Services available


Need anything else?

Contributors list

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 its 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. */{ ... }{ ... }{ ... }

KSS can also support words as Styleguide section names

// Styleguide Forms.Checkboxes.
// - or -
// Styleguide Forms - Special Checkboxes.

Ruby Library Build Status Code Climate

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")


=> <:section>


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


=> <:modifier>


=> ':hover'


=> 'pseudo-class-hover'


=> 'Subtle hover highlight'


You can also initialize the

with a string CSS by using
buttons =< <:section>


=> "Your standard form button."



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 (

, etc).

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

sinatra application.


To hack on KSS, you'll need to install dependencies with

bundle install
. Run tests with

To make your life easier, I suggest

bundle install --binstubs
and adding
to your
. 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.


The KSS specification has also been implemented in Python, Node.js, PHP and Java

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.