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