aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails/stylesheets
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-18 13:44:32 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-18 16:21:11 +0100
commit9fffdc5cdb80b1824473a6d7ae1fedf9e74aa748 (patch)
tree88f429511bf65f1104efeab10d6310b68ab24837 /railties/lib/generators/rails/stylesheets
parente75ea474346e74e36d92febd47985c3571b1472b (diff)
downloadrails-9fffdc5cdb80b1824473a6d7ae1fedf9e74aa748.tar.gz
rails-9fffdc5cdb80b1824473a6d7ae1fedf9e74aa748.tar.bz2
rails-9fffdc5cdb80b1824473a6d7ae1fedf9e74aa748.zip
Generators load path now will be Ruby load path. If you want to use rspec:install generator, you need generators/rspec/install_generator in your load path.
Diffstat (limited to 'railties/lib/generators/rails/stylesheets')
-rw-r--r--railties/lib/generators/rails/stylesheets/USAGE5
-rw-r--r--railties/lib/generators/rails/stylesheets/stylesheets_generator.rb9
-rw-r--r--railties/lib/generators/rails/stylesheets/templates/scaffold.css62
3 files changed, 76 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/stylesheets/USAGE b/railties/lib/generators/rails/stylesheets/USAGE
new file mode 100644
index 0000000000..d6a81e51d0
--- /dev/null
+++ b/railties/lib/generators/rails/stylesheets/USAGE
@@ -0,0 +1,5 @@
+Description:
+ Copies scaffold stylesheets to public/stylesheets/.
+
+Examples:
+ `./script/generate stylesheets`
diff --git a/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb b/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb
new file mode 100644
index 0000000000..ce68443c39
--- /dev/null
+++ b/railties/lib/generators/rails/stylesheets/stylesheets_generator.rb
@@ -0,0 +1,9 @@
+module Rails
+ module Generators
+ class StylesheetsGenerator < Base
+ def copy_stylesheets_file
+ template "scaffold.css", "public/stylesheets/scaffold.css" if behavior == :invoke
+ end
+ end
+ end
+end
diff --git a/railties/lib/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/generators/rails/stylesheets/templates/scaffold.css
new file mode 100644
index 0000000000..d9fa2cf2dc
--- /dev/null
+++ b/railties/lib/generators/rails/stylesheets/templates/scaffold.css
@@ -0,0 +1,62 @@
+body { background-color: #fff; color: #333; }
+
+body, p, ol, ul, td {
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px;
+}
+
+pre {
+ background-color: #eee;
+ padding: 10px;
+ font-size: 11px;
+}
+
+a { color: #000; }
+a:visited { color: #666; }
+a:hover { color: #fff; background-color:#000; }
+
+div.field, div.actions {
+ margin-bottom: 10px;
+}
+
+.notice {
+ color: green;
+}
+
+.fieldWithErrors {
+ padding: 2px;
+ background-color: red;
+ display: table;
+}
+
+#errorExplanation {
+ width: 400px;
+ border: 2px solid red;
+ padding: 7px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+}
+
+#errorExplanation h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ background-color: #c00;
+ color: #fff;
+}
+
+#errorExplanation p {
+ color: #333;
+ margin-bottom: 0;
+ padding: 5px;
+}
+
+#errorExplanation ul li {
+ font-size: 12px;
+ list-style: square;
+}
+