Generates a Sass version of Ext theme. Includes methods for colorizing images.
The Gem is hosted at Gemcutter. Install the gem with: sudo gem install extjs-theme
In the root of your Rails app, first execute the following in your console:
$ xtheme init <path/to/ext> <path/to/stylesheets>
This creates a YAML config file named .xthemeconfig in the application root.
Every subsequent xtheme command will act up those directories. If you download a new version of Ext, simply re-execute xtheme init with the new path (TODO: store in Rails /config dir)
To generate a new Sass theme:
$ xtheme create my-theme
In Rails, this will have created a new directory public/stylesheets/sass/my-theme The generator creates a main include file called my-theme/init.sass (TODO: change to my-theme/all.sass) which contains @include directives for each individual Ext stylesheet. You *no longer need* to include the ext-all.css file from the Ext library – my-theme/init.sass contains all it needs. In a Rails view, you would include this file in the standard Haml/Sass manner.
or in an erb template:
<%= stylesheet_link_tag “my-theme/init”
The generator also creates a copy of all the Ext theme images in my-theme/images
Another important sass file created is my-theme/defines.sass. This file contains Sass variable declarations added to each Ext sass file.
The Gem includes commands for theme colorization, including image-processing through RMagick.
Currently, the only effect available is effects:modulate, for modifying the hue, saturation and lightness of a theme according to RMagick:
$ xtheme effects:modulate <theme-name> <hue> <saturation> <lightness> The parameters hue, saturation and lightness are defined as “Float numbers, for example, 0.25 means ”25%“. All three arguments may be omitted. The default value of each argument is 1.0, that is, 100%” Based upon the default blue Ext theme, the following will generate a pink theme:
$ xtheme effects:modulate my-theme 0.5 1.0 1.0
A green theme:
$ xtheme effects:modulate my-theme 1.5 1.0 1.0
*Only hue works currently, saturation and lightness are under development*
Copyright © 2010 Christocracy. See LICENSE for details.