Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Documenting your CSS using KSS

Documenting your CSS using KSS

Justin Morris

April 26, 2012
Tweet

More Decks by Justin Morris

Other Decks in Technology

Transcript

  1. DOCUMENTING YOUR STYLESHEETS USING A STYLEGUIDE IS AWESOME AND PERHAPS

    YOU SHOULD THINK ABOUT DOING IT. Speaking about...
  2. As your codebase grows it becomes harder and harder to

    create a mental map of it as a whole. This is especially true for your CSS
  3. CONTEXT • We have a fairly large (# of Views)

    app • We have a LOT of UI (editing/reading interfaces) • We have LOTS of CSS (~11k SLOC SCSS) • Everyone at TC writes/maintains/implements front- end code (which is awesome)
  4. CONTEXT • Every day; ... CSS is altered across dozens

    of different commits ... by many devs ... all working in different areas of the codebase
  5. THE PROBLEM ...which leads to this: DEV 1: “I need

    to style this widget, is there a .class for this?” DEV 2: “Who knows! :D Just write even more CSS!” DEV 1: “LOL, Ok! More CSS is better, right? RIGHT!?” ...which results in this (and crap code):
  6. • Write modular, abstracted SASS in dev • Serve compiled,

    compressed CSS in prod • Write less boilerplate, repeat yourself less • Be happier, etc... SASS + COMPASS) + ASSET PIPELINE