Undercase

Undercase is a Rails engine that you can add to your application that provides helpers and assets for common DOM patterns.

Undercase goals

Undercase increases design consistency, lowers long term maintenance costs, and increases efficient responses to client needs by centralizing standards-compliant core patterns in an includable gem for all Casebook products.

What is included in undercase?

Core layout, flexible grid, typography, icons, colors and form elements are the building blocks for Casebook applications.

Features that are composed of those elements which are reused in multiple portions of Casebook or in multiple products should be extracted into Undercase for easier maintenance, extension, and auditing for standards compliance.

Installation

In your Gemfile

gem 'undercase'

Usage

Undercase provides helpers, css rules and mixins, and javascripts that you can use in an application.

Helpers are included automatically when you include the gem.

Example: index.html.haml

= inline_message :warning, "some message"

Use the asset pipeline to require the css and javascript.

Example: in application.css:

/*
//= require undercase
*/

table {
  @include zebra; /* inherited from undercase */

  th { ... }
}

Pattern creation rake task

Undercase provides a rake task to easily create the files needed for a new pattern. In the undercase directory: rake pattern:create[PATTERNNAME,'DISPLAY NAME']

This will append your new pattern to

  • app/assets/stylesheets/undercase/_patterns.scss

This will create new files in:

  • app/assets/stylesheets/undercase/patterns_PATTERNNAME.scss
  • app/views/undercase/patterns/PATTERNNAME.html.haml
  • lib/undercase/patterns/PATTERNNAME.yml

undercase:release rake task

On master branch at root of undercase:

Use undercase:release rake task

  • to do a patch release: run rake undercase:release
  • to do a major/minor release run VERSION=1.2.3 rake undercase:release

Comprised of smaller tasks:

undercase:bump

Sets or increments the version in version.rb.

If given a version, (for major/minor or non-sequential releases) will use that. Otherwise will increment the current version number.

tag

Uses current version number to create tag and push tag

undercase:package

Compiles assets and adds them to tar file

undercase:deploy

Pushes local master branch to github and heroku

Contributing

Undercase is a container for generalizable patterns. Keep the following criteria in mind when creating and submitting a new pattern.

  • It can be used across multiple applications.
  • It works in isolation.
    • It has no awareness the application domain
    • It has no expectation about objects given to it
    • It has no external dependencies (i.e. ActiveRecord, SimpleForm)
  • It has flexible CSS rules
  • It is compatible with multiple browsers (ie9, Firefox, Chrome)

This project is proprietary. Do not push to rubygems.org.

(c) 2014 Case Commons