Git Product home page Git Product logo

extjs-theme's Introduction

extjs-theme

Generates a Sass version of Ext theme. Includes methods for colorizing images.

This Gem depends upon RMagick and haml-edge

Installation

The Gem is hosted at Gemcutter. Install the gem with:

gem install extjs-theme

or add

gem ‘extjs-theme’ to you Gemfile and execute

$ bundle install

Usage

In the root of your Rails app, first execute the following in your console:

$ bundle exec xtheme init <path/to/ext> <path/to/stylesheets/sass-dir>

This creates a YAML config file named config/xtheme.yml in the application root. </path/to/ext> defaults to public/javascripts/ext-3.2 and </path/to/stylesheets/sass-dir> defaults to public/stylesheets/themes.

— theme_dir: app/stylesheets/themes ext_dir: public/javascripts/ext-3.2.0

or generate a custom configuration file by execute the following in your console:

$ bundle exec xtheme init <path/to/ext> <path/to/stylesheets>

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

Example

$ bundle exec xtheme init public/javascripts/ext-3.3.0

To generate a new Sass theme:

$ bundle exec xtheme create my-theme

In Rails, this will have created a new directory public/stylesheets/themes/my-theme

The generator creates a main include file called 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/all.sass contains all it needs. In a Rails view, you would include this file in the standard Haml/Sass manner.

=stylesheet_link_tag “my-theme/all”

or in an erb template:

<%= stylesheet_link_tag “my-theme/all”

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.

$img_path: ‘../themes/my-theme/images’ $font: tahoma,arial,verdana,sans-serif $hue: -90.0

For more on Haml and Sass, consult the HAML documentation to learn about including Sass stylesheets.

Effects

The Gem includes commands for theme colorization, including image-processing through RMagick.

Currently, the only effect available is modulate, for modifying the hue, saturation and lightness of a theme according to RMagick:

$ bundle exec xtheme modulate <theme-name> <hue> <saturation> <lightness>

The parameters hue, saturation and lightness are defined as “Float numbers, for example, 0.25 means ”25%“. The median value of each argument is 1.0, that is, 100%”

Based upon the default blue Ext theme, the following will generate a pink theme:

$ bundle exec xtheme modulate my-theme 0.5 1.0 1.0

A green theme:

$ bundle exec xtheme 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.

extjs-theme's People

Contributors

christocracy avatar netzpirat avatar dcu avatar mbbx6spp avatar

Watchers

Van avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.