CSS Writer plugin

Plugin details

A simple rails plugin for writing a CSS stylesheet from ruby code

Websitehttp://github.com/GavinM/css_writer Repositorygit://github.com/GavinM/css_writer.git Author Gavin Morrice Tags CSS LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/GavinM/css_writer.git

Example
=======

simple example:

  def  create_stylesheet
    CssWriter.new(:name => 'my_stylesheet', 
                  :css_hash => {"background" => {"color" => "#99f"}})
  end


full example:

  def create_stylesheet
    CssWriter.new(:name => "user_#{@user.id}", 
                  :file_path => "#{RAILS_ROOT}/public/stylesheets/user_stylesheets",
                  :comment => "stylesheet for user #{@user.id}",
                  :css_hash => {
                    "html"   => {"color"       => "#ffee33"},
                    "body"   => {"background"   => "#333444"},
                    "h1"      => {"font-size"    => "14px"},
                    "h2"    => {"font-size"    => "15px"}
                  
                    *etc etc etc *
                  })
  end

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 9 months ago