milk1000cc / docomo_css

a rails plugin to in-line css

This URL has Read+Write access

name age message
file .gitignore Thu Jun 11 00:20:06 -0700 2009 Enhance documentation [pwim]
file MIT-LICENSE Wed Jul 09 20:28:05 -0700 2008 first commit [milk1000cc]
file README.rdoc Thu Jun 11 00:20:06 -0700 2009 Enhance documentation [pwim]
file Rakefile Thu Jun 11 00:20:06 -0700 2009 Enhance documentation [pwim]
file VERSION Wed Jun 10 23:27:53 -0700 2009 Create gem with jeweler [pwim]
file docomo_css.gemspec Thu Jun 11 00:31:41 -0700 2009 Regenerated gemspec for version 0.0.1 [pwim]
file init.rb Wed Jun 10 23:46:52 -0700 2009 Cleaner init [pwim]
file install.rb Wed Jul 09 20:28:05 -0700 2008 first commit [milk1000cc]
directory lib/ Thu Jun 11 00:24:37 -0700 2009 Rename to avoid name collisions [pwim]
directory rails/ Wed Jun 10 23:46:52 -0700 2009 Cleaner init [pwim]
directory test/ Thu Jun 11 00:07:19 -0700 2009 Fix bug [pwim]
file uninstall.rb Wed Jul 09 20:28:05 -0700 2008 first commit [milk1000cc]
README.rdoc

DocomoCss

docomo_css is a CSS in-liner.

Most handsets for the Japanese cell-phone carrier DoCoMo cannot use external style sheets, such as

  <link rel="stylesheet" /> style css, only can use in-line CSS.

Instead, every element must use its own style attribute, for example

  <div style="font-size:x-small">

docomo_css works around this by inlining all CSS automatically for you.

Install

  sudo gem install milk1000cc-docomo_css --source=http://gems.github.com

Usage

  # app/controllers/articles_controller.rb
  class ArticlesController < ApplicationController
    docomo_filter  # please add this
    ...
  end

  # app/views/articles/index.html.erb
  <html>
  <head>
    <%= stylesheet_link_tag 'foo', :media => 'handheld, tty' %>
  </head>
  <body>
    <div class="title">bar</div>
  </body>
  </html>

  # public/stylesheets/foo.css
  .title {
    color: red;
  }

  # result
  <html>
  <head>
    <%= stylesheet_link_tag 'foo', :media => 'handheld, tty' %>
  </head>
  <body>
    <div class="title" style="color:red">bar</div>
  </body>
  </html>

Author

Copyright © 2008 milk1000cc, released under the MIT license

milk1000cc <info@milk1000.cc>

Gem and refactorings by Paul McMahon <paul@mobalean.com>